perf: 自动化按钮 (#9008)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2022-11-02 17:27:47 +08:00
committed by GitHub
parent 956367cfed
commit 697b3fb860
14 changed files with 139 additions and 308 deletions

View File

@@ -172,15 +172,3 @@ def hello_random():
def hello_callback(result):
print(result)
print("Hello callback")
@shared_task
def execute_automation_strategy(pid, trigger):
from .models import AutomationStrategy
with tmp_to_root_org():
instance = get_object_or_none(AutomationStrategy, pk=pid)
if not instance:
logger.error("No automation plan found: {}".format(pid))
return
with tmp_to_org(instance.org):
instance.execute(trigger)