Quellcode durchsuchen

Change variable name calc -> predicate

Ask Solem vor 15 Jahren
Ursprung
Commit
0cea91e322
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 2 2
      celery/task/base.py
  2. 2 2
      docs/userguide/routing.rst

+ 2 - 2
celery/task/base.py

@@ -705,7 +705,7 @@ class PeriodicTask(Task):
                       5: lambda x: x / 60}
         args = dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second
         r = None
-        for res, calc in resolution.items():
-            if calc(self.timedelta_seconds(delta)):
+        for res, predicate in resolution.items():
+            if predicate(self.timedelta_seconds(delta)):
                 r = res
         return datetime(*args[:r])

+ 2 - 2
docs/userguide/routing.rst

@@ -19,7 +19,7 @@ the content type of the message and its content encoding. In Celery the
 content type is usually the serialization format used to serialize the
 message, and the body contains the name of the task to execute, the
 task id (UUID), the arguments to execute it with and some additional
-metadata - like the number of retries and its ETA if any.
+metadata - like the number of retries and its ETA (if any).
 
 This is an example task message represented as a Python dictionary:
 
@@ -136,7 +136,7 @@ Declares an exchange by name.
   are no more queues using it.
 
 queue.declare(queue_name, passive, durable, exclusive, auto_delete)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 Declares a queue by name.