Explorar o código

Don't evaluate PeriodicTask.run_every, use hasattr instead, in case implemented by property.

Ask Solem %!s(int64=15) %!d(string=hai) anos
pai
achega
57134038b5
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      celery/task/base.py

+ 1 - 2
celery/task/base.py

@@ -588,12 +588,11 @@ class PeriodicTask(Task):
 
     """
     abstract = True
-    run_every = timedelta(days=1)
     ignore_result = True
     type = "periodic"
 
     def __init__(self):
-        if not self.run_every:
+        if not hasattr(self, "run_every"):
             raise NotImplementedError(
                     "Periodic tasks must have a run_every attribute")