我的任务不适用于 ActionHerojs
My task isn't working of ActionHerojs
exports.sayHelloAction = {
name: 'sayHelloAction',
description: '',
outputExample: {},
version: 1,
inputs: {},
run: function (api, data, next) {
// Enqueue the task now, and process it ASAP
// api.tasks.enqueue(nameOfTask, args, queue, callback)
api.tasks.enqueue("sayHello", null, 'default', function (error, toRun) {
next(error)
});
}
};
我的任务是这样的,但是当我运行我的任务从我的行动中看不到日志(“>>>>>>>>>>”)我的控制台:(
const sayHello = {
name: 'sayHello',
description: 'I say hello',
queue: "default",
plugins: [],
pluginOptions: [],
frequency: 1000,
run: function(api, params, next){
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>")
next(true);
}
};
exports.task = sayHello
版本:Nodejs:7.7,ActionHerojs 17
您查询的是任务,而不是 运行。您需要在您的服务器上启用一些工作人员。
exports.sayHelloAction = {
name: 'sayHelloAction',
description: '',
outputExample: {},
version: 1,
inputs: {},
run: function (api, data, next) {
// Enqueue the task now, and process it ASAP
// api.tasks.enqueue(nameOfTask, args, queue, callback)
api.tasks.enqueue("sayHello", null, 'default', function (error, toRun) {
next(error)
});
}
};
我的任务是这样的,但是当我运行我的任务从我的行动中看不到日志(“>>>>>>>>>>”)我的控制台:(
const sayHello = {
name: 'sayHello',
description: 'I say hello',
queue: "default",
plugins: [],
pluginOptions: [],
frequency: 1000,
run: function(api, params, next){
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>")
next(true);
}
};
exports.task = sayHello
版本:Nodejs:7.7,ActionHerojs 17
您查询的是任务,而不是 运行。您需要在您的服务器上启用一些工作人员。