dbader / dbader/schedule

Start a repeating job at a specific time.

Open
#568 3 comments 8 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
12.3k
Forks
999
PR merge metrics
No merged PRs in 30d

Description

It's very nice that schedule has [`until`](https://schedule.readthedocs.io/en/stable/examples.html#run-a-job-until-a-certain-time), but it feels like the project is missing a `from`(or similarly named function). For example, if I want to run a job every minute between the hours of 10am and 2pm.

The syntax, with until, could be something like the following:
```
schedule.every().minute.from(10:00).until("14:00").do(job)
```

There is some ambiguity about what happens around midnight. I would think a reasonable option would be to
* repeat the job until the `until` time or midnight and
* don't run between 0:00 and the `from` time.

The best workaround that I can think of to get the `from` behavior is to schedule a job at a specific time to run once and have that job schedule other jobs that run until an `until` time. This is a bit clunky to me.

Thanks for the great library!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the existing `until` example and its implementation, then review how recurring jobs are scheduled around day and midnight boundaries. Define the `from` semantics, including the ambiguous midnight behavior, and consider the proposed `schedule.every().minute.from(...).until(...).do(job)` usage done when the behavior and API are specified and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.