jobbyphp / jobby

Manage all your cron jobs without modifying crontab. Handles locking, logging, error emails, and more.
https://packagist.org/packages/hellogerard/jobby
MIT License
1.05k stars 154 forks source link

Option to Disable "lockfile" check #99

Open nebojsac opened 6 years ago

nebojsac commented 6 years ago

Hi there,

I've started using it, and we have a lot of crontabs that we're gradually migrating over to Jobby (great tool btw).

One situation we just ran into was that some jobs are allowed to overlap, or to run as duplicates. This is because we have processes that get killed after running for 1h, but they get a SIGTERM signal and only terminate once they finish what they're doing. This prevents the next instance from starting up.

If there isn't an option to disable the lockfile check in the configuration for certain tasks, I'd gladly look at creating a PR - just let me know if you think this makes sense to add.

BillBuilt commented 6 years ago

This is exactly why I came here today - we need jobs to overlap too. Any way to achieve this?

nebojsac commented 6 years ago

It would have to be changed in the core, I believe. Needs to have an option to not check for a lock file.

The way I'm solving this for now is to have alternating tasks with different names, even if it's essentially the same script.

Alternatively, I set the script to run for 59 minutes, instead of a full 1h, but this doesn't always help.

wujekbogdan commented 5 years ago

@nebojsac There's a workaround. You can use the environment setting and give it a random value. https://github.com/jobbyphp/jobby/issues/86#issuecomment-510872496