MCPcopy Create free account
hub / github.com/apify/crawlee-python / watch_restarts

Method watch_restarts

tests/unit/server.py:517–530  ·  view source on GitHub ↗

Watch for and handle restart requests.

(self)

Source from the content-addressed store, hash-verified

515 await asyncio.sleep(0.2)
516
517 async def watch_restarts(self) -> None:
518 """Watch for and handle restart requests."""
519 while True:
520 if self.should_exit:
521 return
522
523 try:
524 await asyncio.wait_for(self.restart_requested.wait(), timeout=0.1)
525 except asyncio.TimeoutError:
526 continue
527
528 self.restart_requested.clear()
529 await self.shutdown()
530 await self.startup()
531
532 def run(self, sockets: list[socket] | None = None) -> None:
533 """Run the server."""

Callers 1

serveMethod · 0.95

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected