开发者

Why would my rake tasks running via cron get invoked twice?

开发者 https://www.devze.com 2023-01-04 04:34 出处:网络
I have a rails app with the whenever gem installed to setup cron jobs which invoke various rake tasks. For reasons unbeknownst to me, each rake task gets invoked twice at precisely the same time. So m

I have a rails app with the whenever gem installed to setup cron jobs which invoke various rake tasks. For reasons unbeknownst to me, each rake task gets invoked twice at precisely the same time. So my db backup task backs up the db twice at 4:00am.

Inspecting crontab reveals co开发者_StackOverflow社区rrect syntax for all of the cron jobs, so I don't think this is an issue with the whenever gem not correctly configuring the cron jobs. Also confusing is that in both staging and production environments and can invoke tasks on the command line and they only run once.

Any thoughts on what would cause this? I'm at a complete loss troubleshooting wise.


The number of cron jobs that run depends on the number of application instances running in the server box. Are you have two instances of rails application running in the same server box?

0

精彩评论

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