Merge pull request #2927 from bookwyrm-social/streams-queue

Reduce activity in streams queue from boost tasks
This commit is contained in:
Mouse Reeve 2023-07-30 18:37:49 -07:00 committed by GitHub
commit 588ec80b4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -343,6 +343,10 @@ def add_status_on_create(sender, instance, created, *args, **kwargs):
def add_status_on_create_command(sender, instance, created): def add_status_on_create_command(sender, instance, created):
"""runs this code only after the database commit completes""" """runs this code only after the database commit completes"""
# boosts trigger 'saves" twice, so don't bother duplicating the task
if sender == models.Boost and not created:
return
priority = STREAMS priority = STREAMS
# check if this is an old status, de-prioritize if so # check if this is an old status, de-prioritize if so
# (this will happen if federation is very slow, or, more expectedly, on csv import) # (this will happen if federation is very slow, or, more expectedly, on csv import)