소스 검색

subtask.apply* args, kwargs should be optional

Ask Solem 15 년 전
부모
커밋
564f10530b
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      celery/task/sets.py

+ 2 - 2
celery/task/sets.py

@@ -77,7 +77,7 @@ class subtask(AttributeDict):
         """Shortcut to ``apply_async(argmerge, kwargs)``."""
         """Shortcut to ``apply_async(argmerge, kwargs)``."""
         return self.apply_async(args=argmerge, kwargs=kwmerge)
         return self.apply_async(args=argmerge, kwargs=kwmerge)
 
 
-    def apply(self, args, kwargs, **options):
+    def apply(self, args=(), kwargs={}, **options):
         """Apply this task locally."""
         """Apply this task locally."""
         # For callbacks: extra args are prepended to the stored args.
         # For callbacks: extra args are prepended to the stored args.
         args = tuple(args) + tuple(self.args)
         args = tuple(args) + tuple(self.args)
@@ -85,7 +85,7 @@ class subtask(AttributeDict):
         options = dict(self.options, **options)
         options = dict(self.options, **options)
         return self.get_type().apply(args, kwargs, options)
         return self.get_type().apply(args, kwargs, options)
 
 
-    def apply_async(self, args, kwargs, **options):
+    def apply_async(self, args=(), kwargs={}, **options):
         """Apply this task asynchronously."""
         """Apply this task asynchronously."""
         # For callbacks: extra args are prepended to the stored args.
         # For callbacks: extra args are prepended to the stored args.
         args = tuple(args) + tuple(self.args)
         args = tuple(args) + tuple(self.args)