@@ -291,33 +291,35 @@ def __repr__(self):
291
291
292
292
293
293
def cron (* ,
294
- dft_queue = None ,
295
- run_at_startup = False ,
296
- unique = True ,
297
294
month : Union [None , set , int ]= None ,
298
295
day : Union [None , set , int ]= None ,
299
296
weekday : Union [None , set , int , str ]= None ,
300
297
hour : Union [None , set , int ]= None ,
301
298
minute : Union [None , set , int ]= None ,
302
299
second : Union [None , set , int ]= 0 ,
303
- microsecond : int = 123456 ):
300
+ microsecond : int = 123456 ,
301
+ dft_queue = None ,
302
+ run_at_startup = False ,
303
+ unique = True ):
304
304
"""
305
+ Decorator which defines a functions as a cron job, eg. it should be executed at specific times.
305
306
306
- Decorator which defines a functions as a cron job, eg. it should be executed at specific times...
307
+ Workers will enqueue this job at or just after the set times. If ``unique`` is true (the default) the
308
+ job will only be enqueued once even if multiple workers are running.
307
309
308
310
If you wish to call the function directly you can access the original function at ``<func>.direct``.
309
311
310
- :param dft_queue: default queue to use
311
- :param run_at_startup: whether to run as worker starts
312
- :param unique: whether the job should be only be executed on one worker.
313
312
:param month: month(s) to run the job on, 1 - 12
314
313
:param day: day(s) to run the job on, 1 - 31
315
314
:param weekday: week day(s) to run the job on, 0 - 6 or mon - sun
316
315
:param hour: hour(s) to run the job on, 0 - 23
317
316
:param minute: minute(s) to run the job on, 0 - 59
318
317
:param second: second(s) to run the job on, 0 - 59
319
318
:param microsecond: microsecond(s) to run the job on,
320
- defaults to 123456 as the world is busier at the top of a second 0 - 1e6
319
+ defaults to 123456 as the world is busier at the top of a second, 0 - 1e6
320
+ :param dft_queue: default queue to use
321
+ :param run_at_startup: whether to run as worker starts
322
+ :param unique: whether the job should be only be executed once at each time
321
323
"""
322
324
323
325
return lambda f : CronJob (
0 commit comments