django-q2 / django-q2

A multiprocessing distributed task queue for Django based on Django-Q
https://django-q2.readthedocs.io
MIT License
342 stars 33 forks source link

Scheduled tasks only process every 30 seconds #181

Open xaqbr opened 4 months ago

xaqbr commented 4 months ago

https://github.com/django-q2/django-q2/blob/7add68f7709856f875bf145d59374adc80112009/django_q/cluster.py#L317

Is there a reason why the cluster command's schedule processing is locked at running once every 30 seconds? I have scheduled tasks that need to run between that range of time, but there are no available configuration options to change the delay. I'm not too familiar with the project's internals so if it's an optimization issue then I understand.

GDay commented 4 months ago

I don't think there are technical limits (as long as the pusher gets ran enough), but I think once a minute was used as the default to not have the scheduler ran too many times. For every time the scheduler gets called, it will make requests to the database which could lead to a lot of unnecessary calls. It adds up when it needs to check on seconds.