@@ -33,7 +33,7 @@ async def redis_connection(cls):
33
33
run_task = asyncio .create_task (run_coro )
34
34
await asyncio .wait_for (worker .started .wait (), timeout = 1 )
35
35
36
- scheduled_task = await task_queue .add_task ({"function " : "job" , "kwargs" : {}})
36
+ scheduled_task = await task_queue .add_task ({"name " : "job" , "kwargs" : {}})
37
37
38
38
await asyncio .wait_for (event .wait (), timeout = 1 )
39
39
await worker .stop ()
@@ -69,7 +69,7 @@ async def redis_connection(cls):
69
69
run_task = asyncio .create_task (run_coro )
70
70
await asyncio .wait_for (worker .started .wait (), timeout = 1 )
71
71
72
- scheduled_task = await task_queue .add_task ({"function " : "job" , "kwargs" : {}})
72
+ scheduled_task = await task_queue .add_task ({"name " : "job" , "kwargs" : {}})
73
73
74
74
await asyncio .wait_for (event .wait (), timeout = 1 )
75
75
await worker .stop ()
@@ -103,7 +103,7 @@ async def redis_connection(cls):
103
103
run_task = asyncio .create_task (run_coro )
104
104
await asyncio .wait_for (worker .started .wait (), timeout = 1 )
105
105
106
- scheduled_task = await task_queue .add_task ({"function " : "job" , "kwargs" : {}})
106
+ scheduled_task = await task_queue .add_task ({"name " : "job" , "kwargs" : {}})
107
107
108
108
await asyncio .wait_for (event .wait (), timeout = 1 )
109
109
await asyncio .wait_for (worker .completed_task .wait (), timeout = 1 )
@@ -132,8 +132,8 @@ async def redis_connection(cls):
132
132
133
133
worker = build_worker (redis_connection , Settings , [task_queue .name ], max_jobs = 1 )
134
134
135
- scheduled_task_1 = await task_queue .add_task ({"function " : "job" , "kwargs" : {}})
136
- scheduled_task_2 = await task_queue .add_task ({"function " : "job" , "kwargs" : {}})
135
+ scheduled_task_1 = await task_queue .add_task ({"name " : "job" , "kwargs" : {}})
136
+ scheduled_task_2 = await task_queue .add_task ({"name " : "job" , "kwargs" : {}})
137
137
138
138
run_coro = worker .run ()
139
139
run_task = asyncio .create_task (run_coro )
@@ -171,7 +171,7 @@ async def redis_connection(cls):
171
171
run_task = asyncio .create_task (run_coro )
172
172
await asyncio .wait_for (worker .started .wait (), timeout = 1 )
173
173
174
- scheduled_task = await task_queue .add_task ({"function " : "job" , "kwargs" : {}})
174
+ scheduled_task = await task_queue .add_task ({"name " : "job" , "kwargs" : {}})
175
175
await asyncio .wait_for (worker .got_task .wait (), timeout = 1 )
176
176
177
177
await worker .stop ()
@@ -208,7 +208,7 @@ async def redis_connection(cls):
208
208
run_task = asyncio .create_task (run_coro )
209
209
await asyncio .wait_for (worker .started .wait (), timeout = 1 )
210
210
211
- scheduled_task = await task_queue .add_task ({"function " : "job" , "kwargs" : {}})
211
+ scheduled_task = await task_queue .add_task ({"name " : "job" , "kwargs" : {}})
212
212
await asyncio .wait_for (worker .got_task .wait (), timeout = 1 )
213
213
214
214
await worker .stop ()
@@ -240,7 +240,7 @@ async def redis_connection(cls):
240
240
run_task = asyncio .create_task (run_coro )
241
241
await asyncio .wait_for (worker .started .wait (), timeout = 1 )
242
242
243
- scheduled_task = await task_queue .add_task ({"function " : "job" , "kwargs" : {}})
243
+ scheduled_task = await task_queue .add_task ({"name " : "job" , "kwargs" : {}})
244
244
await asyncio .wait_for (worker .got_task .wait (), timeout = 1 )
245
245
246
246
await worker .stop ()
@@ -275,7 +275,7 @@ async def redis_connection(cls):
275
275
run_task = asyncio .create_task (run_coro )
276
276
await asyncio .wait_for (worker .started .wait (), timeout = 1 )
277
277
278
- scheduled_task = await task_queue .add_task ({"function " : "job" , "kwargs" : {}})
278
+ scheduled_task = await task_queue .add_task ({"name " : "job" , "kwargs" : {}})
279
279
await asyncio .wait_for (worker .got_task .wait (), timeout = 1 )
280
280
281
281
await worker .stop ()
@@ -308,7 +308,7 @@ async def redis_connection(cls):
308
308
await asyncio .wait_for (worker .started .wait (), timeout = 1 )
309
309
310
310
scheduled_task = await task_queue .add_task (
311
- {"function " : "job" , "kwargs" : {}}, retry_policy = RetryPolicy .LINEAR
311
+ {"name " : "job" , "kwargs" : {}}, retry_policy = RetryPolicy .LINEAR
312
312
)
313
313
await asyncio .wait_for (worker .got_task .wait (), timeout = 1 )
314
314
@@ -332,7 +332,7 @@ async def redis_connection(cls):
332
332
factory_kwargs = {"handlers" : {}}
333
333
334
334
scheduled_task = await task_queue .add_task (
335
- {"function " : "job" , "kwargs" : {}}, task_timeout = 0
335
+ {"name " : "job" , "kwargs" : {}}, task_timeout = 0
336
336
)
337
337
await task_queue .get_task ()
338
338
@@ -359,7 +359,7 @@ async def redis_connection(cls):
359
359
return redis_connection
360
360
361
361
@staticmethod
362
- async def on_task_process_exception (exc_info ):
362
+ async def on_task_process_exception (job , exc_info ):
363
363
exception_handler ()
364
364
365
365
queue_namespace = task_queue .namespace
@@ -371,7 +371,7 @@ async def on_task_process_exception(exc_info):
371
371
run_task = asyncio .create_task (run_coro )
372
372
await asyncio .wait_for (worker .started .wait (), timeout = 1 )
373
373
374
- scheduled_task = await task_queue .add_task ({"function " : "job" , "kwargs" : {}})
374
+ scheduled_task = await task_queue .add_task ({"name " : "job" , "kwargs" : {}})
375
375
await asyncio .wait_for (worker .got_task .wait (), timeout = 1 )
376
376
377
377
await worker .stop ()
@@ -411,7 +411,7 @@ async def on_task_process_exception(exc_info):
411
411
run_task = asyncio .create_task (run_coro )
412
412
await asyncio .wait_for (worker .started .wait (), timeout = 1 )
413
413
414
- scheduled_task = await task_queue .add_task ({"function " : "job" , "kwargs" : {}})
414
+ scheduled_task = await task_queue .add_task ({"name " : "job" , "kwargs" : {}})
415
415
await asyncio .wait_for (worker .got_task .wait (), timeout = 1 )
416
416
417
417
await worker .stop ()
0 commit comments