mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-04 16:18:13 +08:00
+2
-2
@@ -108,12 +108,12 @@ def save_task(task, broker: Broker):
|
|||||||
filters[Conf.SAVE_LIMIT_PER] = value
|
filters[Conf.SAVE_LIMIT_PER] = value
|
||||||
|
|
||||||
with db.transaction.atomic(using=db.router.db_for_write(Success)):
|
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 (
|
if (
|
||||||
task["success"]
|
task["success"]
|
||||||
and 0 < Conf.SAVE_LIMIT <= Success.objects.filter(**filters).count()
|
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
|
# check if this task has previous results
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user