【发布时间】:2016-10-23 10:28:31
【问题描述】:
我已经关注了这个答案here 并且它有效,但是当我尝试调用我的应用程序时没有任何反应。我在 app.js 中调用了我的主要功能
function start() { ... }
这是我存储在 bin 中的任务,我知道它在我调用时可以工作:
#! /app/.heroku/node/bin/node
function mytask() {
start();
}
initScrape();
process.exit();
之后:heroku run init mytask
λ heroku run init_scrape
Running mytask on dyno1... up, run.5157
/app/bin/mytask:3
start();
^
ReferenceError: start is not defined
at mytask (/app/bin/mytask:3:3)
at Object.<anonymous> (/app/bin/mytask:5:1)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:148:18)
at node.js:405:3
【问题讨论】:
标签: node.js heroku scheduled-tasks