agronholm / apscheduler

Task scheduling library for Python
MIT License
5.94k stars 690 forks source link

Implement schedule filters #906

Open agronholm opened 1 month ago

agronholm commented 1 month ago

Things to check first

Feature description

Schedules would receive the ability to filter run times returned from a trigger. If a filter rejects a run time, then the next fire time would be requested from the trigger, until a fire time is received that passes all the filters.

This function was previously served by AndTrigger, but it has proven to be very problematic in practice. There might be grounds for removal of AndTrigger if this feature is implemented.

Use case

A common use case for this is skipping holidays, as that requires special logic that would ordinarily require customizing a trigger.