开发者

whenever gem minutely job. If minutely job takes more than one minute then what

I am pl开发者_运维技巧annning to use whenever gem which among other things will also run minutely rake task. If my rake task takes more than a minute then based on the output from whenever gem it seems like the second instance of the rake task will kick-in even though the first one is not quite finished.

Will whenever gem will wait for the miutely task to finish before starting the second one?

If not then what are the workarounds. I believe this question is better served in serverfault still I am putting it here.


whenever just writes cronjobs, and makes no effort to stop them overrunning themselves. This is the job of the task that is being run.

Use PID files, or file system locks to prevent the task running over the top of itself.


In my scheduled application, I scan the process list looking for other instances of my application running with the same configuration file on the command line - then exit with a logged note if a process is already running with the same configuration file.

That keeps the program from stepping on itself ...

PID files or some type of "locking" file are prone to problems when the process exits but the lock file still exists.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜