Install a `SIGTERM` + `SIGINT` handler saving the schedule.
(self, service: beat.Service)
| 153 | ) |
| 154 | |
| 155 | def install_sync_handler(self, service: beat.Service) -> None: |
| 156 | """Install a `SIGTERM` + `SIGINT` handler saving the schedule.""" |
| 157 | def _sync(signum: Signals, frame: FrameType) -> None: |
| 158 | service.sync() |
| 159 | raise SystemExit() |
| 160 | platforms.signals.update(SIGTERM=_sync, SIGINT=_sync) |