问题
项目中的celery突然就不能正常工作了,排查了很久,发现就是celery一直不发送出数据出来,启动beat进程后控制台最后输出了“beat: Waking up in 5.00 minutes”
,然后一直在阻塞中:
$ celery beat -A tasks.tasks -l debug
celery beat v4.3.0 (rhubarb) is starting.
__ - ... __ - _
LocalTime -> 2021-08-11 18:47:59
Configuration ->
. broker -> redis://:**@127.0.0.1:6378/8
. loader -> celery.loaders.app.AppLoader
. scheduler -> celery.beat.PersistentScheduler
. db -> celerybeat-schedule
. logfile -> [stderr]@%DEBUG
. maxinterval -> 5.00 minutes (300s)
[2021-08-11 18:47:59,767: DEBUG/MainProcess] Setting default socket timeout to 30
[2021-08-11 18:47:59,767: INFO/MainProcess] beat: Starting...
[2021-08-11 18:47:59,792: DEBUG/MainProcess] Current schedule:
<ScheduleEntry: connect_hanxin_1 tasks.tasks.refresh_ip_hanxin() <freq: 1.00 second>
<ScheduleEntry: add-every-2-seconds tasks.tasks.uncomplete_tasks() <freq: 2.00 seconds>
<ScheduleEntry: net-2-seconds tasks.tasks.get_net_now_task() <freq: 2.00 seconds>
[2021-08-11 18:47:59,792: DEBUG/MainProcess] beat: Ticking with max interval->5.00 minutes
[2021-08-11 18:47:59,793: DEBUG/MainProcess] beat: Waking up in 5.00 minutes.
解决方案:
问题的原因没有找到为什么,但是通过网上的有些讨论,将celery项目目录下的celerybeat-schedule
删除掉即可。