浏览代码

Added a check for syncing the schedule even if nothing is in the schedule.

Colin McIntosh 10 年之前
父节点
当前提交
7d5a062280
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      celery/beat.py

+ 2 - 0
celery/beat.py

@@ -504,6 +504,8 @@ class Service(object):
                     debug('beat: Waking up %s.',
                     debug('beat: Waking up %s.',
                           humanize_seconds(interval, prefix='in '))
                           humanize_seconds(interval, prefix='in '))
                     time.sleep(interval)
                     time.sleep(interval)
+                    if self.scheduler.should_sync():
+                        self.scheduler._do_sync()
         except (KeyboardInterrupt, SystemExit):
         except (KeyboardInterrupt, SystemExit):
             self._is_shutdown.set()
             self._is_shutdown.set()
         finally:
         finally: