瀏覽代碼

celery.execute.apply: Make sure kwargs["task_id"] is set.

Ask Solem 14 年之前
父節點
當前提交
8be2fccb04
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      celery/execute/__init__.py

+ 1 - 1
celery/execute/__init__.py

@@ -174,7 +174,7 @@ def apply(task, args, kwargs, **options):
     """
     args = args or []
     kwargs = kwargs or {}
-    task_id = options.get("task_id", gen_unique_id())
+    task_id = options.get("task_id") or gen_unique_id()
     retries = options.get("retries", 0)
     throw = options.pop("throw", conf.EAGER_PROPAGATES_EXCEPTIONS)