mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 13:37:56 +08:00
@@ -108,12 +108,12 @@ def save_task(task, broker: Broker):
|
||||
filters[Conf.SAVE_LIMIT_PER] = value
|
||||
|
||||
with db.transaction.atomic(using=db.router.db_for_write(Success)):
|
||||
last = Success.objects.filter(**filters).select_for_update().last()
|
||||
list(Success.objects.filter(**filters).select_for_update())
|
||||
if (
|
||||
task["success"]
|
||||
and 0 < Conf.SAVE_LIMIT <= Success.objects.filter(**filters).count()
|
||||
):
|
||||
last.delete()
|
||||
Success.objects.filter(**filters).last().delete()
|
||||
|
||||
# check if this task has previous results
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user