(self, embedded_process=False)
| 631 | self.schedule_filename, self.scheduler_cls) |
| 632 | |
| 633 | def start(self, embedded_process=False): |
| 634 | info('beat: Starting...') |
| 635 | debug('beat: Ticking with max interval->%s', |
| 636 | humanize_seconds(self.scheduler.max_interval)) |
| 637 | |
| 638 | signals.beat_init.send(sender=self) |
| 639 | if embedded_process: |
| 640 | signals.beat_embedded_init.send(sender=self) |
| 641 | platforms.set_process_title('celery beat') |
| 642 | |
| 643 | try: |
| 644 | while not self._is_shutdown.is_set(): |
| 645 | interval = self.scheduler.tick() |
| 646 | if interval and interval > 0.0: |
| 647 | debug('beat: Waking up %s.', |
| 648 | humanize_seconds(interval, prefix='in ')) |
| 649 | time.sleep(interval) |
| 650 | if self.scheduler.should_sync(): |
| 651 | self.scheduler._do_sync() |
| 652 | except (KeyboardInterrupt, SystemExit): |
| 653 | self._is_shutdown.set() |
| 654 | finally: |
| 655 | self.sync() |
| 656 | |
| 657 | def sync(self): |
| 658 | self.scheduler.close() |
no test coverage detected