fastapi-utils icon indicating copy to clipboard operation
fastapi-utils copied to clipboard

Add a decorator like @repeat_at?

Open triptec opened this issue 4 years ago • 4 comments

Hi! I find myself wanting a decorator like @repeat_at(cron="0 0 13 * * *") to run the task at 1 pm every day, if I where to implement something like that would you consider merging it to this repo?

probably using croniter for the parsing and just getting the numbers of seconds to sleep and just using the same logic as repeat_every

triptec avatar Mar 25 '21 14:03 triptec

@triptec excellent point! Do you mind to implement in a schedule every().[dayOfWeek].at(hour) like?

moraesjeremias avatar Apr 08 '21 18:04 moraesjeremias

I wouldn’t know how to do that I’m afraid. What’s the upside of doing it that way?

triptec avatar Apr 08 '21 19:04 triptec

hi @triptec 👋

Liked your idea, this was really helpful decorator for us & decided to contribute for project.

jykae avatar May 11 '21 13:05 jykae

:+1:

triptec avatar May 19 '21 12:05 triptec