Convox Community

Production & Staging Timers

I have two stacks: production and staging. Both have the same exact codebase and use the same convox.yml.

If I setup a cron job (aka Timers) and both racks have the same convox.yml I will have the exact same cron job running twice. This is something that I do not want to happen.

Is there a way to prevent this without having to remove manually the timer from the convox.yml from my staging branch and then adding back the timer to convox.yml when merging to the production branch?

Any idea/solution would be much appreciated.

I don’t know if this is an option for you but what we do currently is call our application code from the cron job and the code exits early of it is not running in the correct environment. I’d definitely be interested in a better solution though.

1 Like

@julian I’m stuck in trying to get my timer running, I opened this topic Timer not found. Do you know what I’m doing wrong?

Yeah, if you want to have differences between your environments like that, because your timers are affecting the same things or whatever, you could introduce checks based on the RACK env var to determine whether to run.

1 Like