复制celery 任务

laawzig2  于 2021-06-09  发布在  Redis
关注(0)|答案(0)|浏览(267)

我有一个celery 任务的问题,应用程序部署在heroku上。当我创建任务时,使用eta,我得到了许多重复的任务,我认为这是由于redis在heroku上重新启动,然后任务将被复制。谢谢你的回答!

$ celery inspect scheduled

-> celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4: OK

* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}
* {'eta': '2020-04-16T10:21:00+00:00', 'priority': 6, 'request': {'id': '5ea46d5e-a6b3-43bc-9228-73833624e8b2', 'name': 'task_module.tasks.send_reminder', 'args': [41407234, '8'], 'kwargs': {}, 'type': 'task_module.tasks.send_reminder', 'hostname': 'celery@78640d9a-168a-43c4-88f9-8cd4c81ca8b4', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'worker_pid': None}}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题