Workload Scheduler for Node.js script - is it equivalent to cron jobs in Bluemix?

馋奶兔 提交于 2019-12-05 07:47:01

You should modify your NodeJS application to let it expose a method that can be run using the curl command and provides the proper output and logging. The curl calling the method will then be run in the Workload Scheduler job. Workload Scheduler service is not part of the node runtime.

I suppose your application is using the built-in node.js buildpack in Bluemix. If that's true then node should be in the path. But it's not clear to me this scheduler service can parse the command "node file.js" correctly. Maybe it is expecting only one command without parameters? Could you try to put a script file that executes "node file.js", say run.sh, and then let the CommandStep invoke this script?

Franco Mossotto

As said by lmosca in her answer, Workload Scheduler service is running outside Node.js, but you can use it to trigger you code running on Node.js and exposed as REST.

In addition to using curl, you can define a REST step in your process in Workload Scheduler, to call your REST API without using curl.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!