Install a `SIGTERM` + `SIGINT` handler saving the schedule.
(self, service: beat.Service)
| 165 | ) |
| 166 | |
| 167 | def install_sync_handler(self, service: beat.Service) -> None: |
| 168 | """Install a `SIGTERM` + `SIGINT` handler saving the schedule.""" |
| 169 | def _sync(signum: Signals, frame: FrameType) -> None: |
| 170 | service.sync() |
| 171 | raise SystemExit() |
| 172 | platforms.signals.update(SIGTERM=_sync, SIGINT=_sync) |