Reduce activity in streams queue from boost tasks

This commit is contained in:
Mouse Reeve 2023-07-30 13:07:12 -07:00
parent 30f025dbcd
commit 71dc05f894

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):
"""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
# 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)