dailybruin / meow

Daily Bruin's homemade social media manager
GNU Affero General Public License v3.0
59 stars 15 forks source link

Improve Celery fetch task logic #403

Closed RandomY-2 closed 1 year ago

RandomY-2 commented 1 year ago

Currently, Celery finds posts that can be sent by periodically querying the database to look for entries that can be sent. Most of these requests will be wasted. We can switch to a "push" based task scheduling by letting meow directly push tasks to celery with the Celery eta attribute set to the interval between the user request and the scheduled publish time. This should reduce the number of database queries Celery needs to make per day