Updates mocks

This commit is contained in:
Mouse Reeve
2021-11-12 08:55:47 -08:00
parent 3190ef4346
commit f71ef286b6
4 changed files with 21 additions and 15 deletions

View File

@ -277,12 +277,12 @@ 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"""
priority=HIGH
priority = HIGH
# 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)
one_day = 60 * 60 * 24
if (instance.created_date - instance.published_date).seconds > one_day:
priority=LOW
priority = LOW
add_status_task.apply_async(
args=(instance.id,),