From a0ce0b263f7f45d78f0fefa9698cb082e59e6986 Mon Sep 17 00:00:00 2001 From: Versun Date: Fri, 5 Jul 2024 06:51:42 +0000 Subject: [PATCH] feat: update schedule tasks with args and delay --- core/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/admin.py b/core/admin.py index 8f2bf16..37f9785 100644 --- a/core/admin.py +++ b/core/admin.py @@ -47,7 +47,7 @@ def save_formset(self, request, form, formset, change): instance.status = None instance.save() #revoke_tasks_by_arg(instance.sid) - update_translated_feed.schedule(args=(instance.sid,), force=True) + update_translated_feed.schedule(args=(instance.sid,True), delay=1) for instance in formset.deleted_objects: #revoke_tasks_by_arg(instance.sid) @@ -66,7 +66,7 @@ def save_model(self, request, obj, form, change): obj.name = obj.name or "Loading" obj.save() update_original_feed.schedule( - args=(obj.sid,), delay=1, force=True + args=(obj.sid,True), delay=1 ) # 会执行一次save() # 不放在model的save里是为了排除translator的更新,省流量 elif frequency_changed: obj.save()