peppeocchi / php-cron-scheduler

PHP cron job scheduler
MIT License
808 stars 143 forks source link

Ability to cancel a job before it's being executed #71

Closed rafal-sokolowski closed 5 years ago

rafal-sokolowski commented 5 years ago

I'd be quite handy to have the ability to prevent a job from being executed if the condition in before method it's not met.

peppeocchi commented 5 years ago

Hi @rafal-sokolowski you can accomplish the same thing by chaining the when method to your job schedule https://github.com/peppeocchi/php-cron-scheduler#schedule-conditional-execution, the before method is meant to do something before the job runs (e.g. writing to a log file).

Feel free to reopen this issue if this doesn't work for you.