Skip to content

Commit

Permalink
Log changed files on reload (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkhav authored Aug 5, 2024
1 parent 7bb6908 commit 0ed1642
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion granian/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,10 @@ def _serve_with_reloader(self, spawn_target, target_loader):
sock = self.startup(spawn_target, target_loader)

try:
for _ in watchfiles.watch(reload_path, stop_event=self.main_loop_interrupt):
for changes in watchfiles.watch(reload_path, stop_event=self.main_loop_interrupt):
logger.info('Changes detected, reloading workers..')
for change, file in changes:
logger.info(f'{change.raw_str().capitalize()}: {file}')
self._stop_workers()
self._spawn_workers(sock, spawn_target, target_loader)
except StopIteration:
Expand Down

0 comments on commit 0ed1642

Please sign in to comment.