Tornium / tornium

A website and Discord bot to assist with the playing of Torn City developed with love <3
https://tornium.com
11 stars 5 forks source link

Higher frequency Celery tasks #186

Closed dssecret closed 2 months ago

dssecret commented 1 year ago

Scheduling tasks via crontabs has a maximum wait of one minute between tasks.

Instead, certain tasks can schedule a new task invocation via delay or apply_async and storing an identifier for the new task in a redis set to be removed upon task start. This allows a separate task to reinitiate any necessary tasks if they weren't properly readied. However this needs to be implemented in such a way that the new task isn't marked as a child as to prevent increased memory overhead.