Monthly tasks
It would be great if this library can schedule tasks for a specific day of the month, for example schedule a task to run always at the first day of the month (1st January, 1st February, 1st March, ...).
I'll likely need this feature soon as well, so if no one else is working on it I might see if I can implement it in the next month or two. @philippeowagner - I took a brief look into this and it seems like it may not be too difficult to implement, though I would definitely welcome some feedback from one of the maintainers.
I think that a low-lift solution would be to add in support for different repeat units in the Task model via a new repeat_unit field. This would set the units for the existing repeat field so that users could specify frequencies such as "every 1 month" or "every 3 years" rather than the current model of specifying everything in seconds. As far as I can tell, this would require minimal changes as the only place that the repeat rate seems to be used is in creating the next Task object in the Task.create_repetition method. This also provides an easy migration path as existing Task models can have their repeat_unit fields set to SECONDS.
Let me know if I seem to be missing something with this, or if there are any gotchas that I should be conscious of - otherwise I'll try to take a stab at this when I have some time.
Why not repeat on daily base and return early if you the day is not required dom?
@jtimmons any updates on this one?
Sorry for the radio silence - the project that was using this library was paused at the beginning of the year so this dropped off my todo list.
I’ve got most of a working implementation of this in place already, so I’ll button it up and put up a PR in the next week or so.
I've added cron expression support to this script to fit my scheduling needs. For example, I can use a cron expression like this: "0 7-19/2 * *", which runs from 7am-7pm, every 2 hours.
The below call shows roughly how my changes are called.
# This is how I run a cron based scheduled task. This expression evaluates to first of every month at 6am.
run_hello_world_task(schedule={'cron':"0 6 1 * *"})
I'm not sure how best to share my changes or updates should anyone be interested. I have retained all backwards compatibility.