You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the script locally, logs show the returned value (here 0), but script doesn't stop. It's still runnnig.
Checking the call/index.js code of this repo, I see that when an error is thrown, process.exit() is called and script ends. But when everything goes right, the broker is stopped, but no process.exit() is called.
Maybe it is not as easy as it seems. I just added process.exit(0) after the broker stops. It surely stops, but with code 130 (using #!/bin/sh as 1st line of my script).
When using the config file, with process.exit(0) in stopped() method, it exits with code 0.
I'm using this command to run a script from a CRON:
The
test
action is as simple as:When running the script locally, logs show the returned value (here
0
), but script doesn't stop. It's still runnnig.Checking the
call/index.js
code of this repo, I see that when an error is thrown,process.exit()
is called and script ends. But when everything goes right, the broker is stopped, but noprocess.exit()
is called.https://github.com/moleculerjs/moleculer-cli/blob/master/src/call/index.js#LL75C24-L75C24
Because of that, CRON job can't detect the end of the script. After a few days, I have tons of CRON jobs running in the wild.
Should the successful call be followed by an exit code of zero, or should I explore an other way to say to my CRON "ok, job's done"?
Thanks.
The text was updated successfully, but these errors were encountered: