| 101 | self.process.start() |
| 102 | |
| 103 | def shutdown(self) -> None: |
| 104 | if sys.platform == "win32": |
| 105 | self.should_exit.set() # pragma: py-not-win32 |
| 106 | else: |
| 107 | self.process.terminate() # pragma: py-win32 |
| 108 | self.process.join() |
| 109 | |
| 110 | for sock in self.sockets: |
| 111 | sock.close() |
| 112 | |
| 113 | message = f"Stopping reloader process [{str(self.pid)}]" |
| 114 | color_message = "Stopping reloader process [{}]".format(click.style(str(self.pid), fg="cyan", bold=True)) |
| 115 | logger.info(message, extra={"color_message": color_message}) |
| 116 | |
| 117 | def should_restart(self) -> list[Path] | None: |
| 118 | raise NotImplementedError("Reload strategies should override should_restart()") |