Merge pull request #1391 from bookwyrm-social/reprioritize-status-task

Prioritize adding statuses to streams
This commit is contained in:
Mouse Reeve 2021-09-09 17:38:08 -07:00 committed by GitHub
commit e562326f02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -432,9 +432,9 @@ def remove_status_task(status_ids):
stream.remove_object_from_related_stores(status) stream.remove_object_from_related_stores(status)
@app.task(queue="medium_priority") @app.task(queue="high_priority")
def add_status_task(status_id, increment_unread=False): def add_status_task(status_id, increment_unread=False):
"""remove a status from any stream it might be in""" """add a status to any stream it should be in"""
status = models.Status.objects.get(id=status_id) status = models.Status.objects.get(id=status_id)
for stream in streams.values(): for stream in streams.values():
stream.add_status(status, increment_unread=increment_unread) stream.add_status(status, increment_unread=increment_unread)