Skip to content

Commit bcc17ac

Browse files
committed
only set USR1 handler if it exists
1 parent 37b9c18 commit bcc17ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

py_wtf/cli/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ async def index_since(directory: str, since: datetime, trace: IO[str] | None) ->
195195

196196
logger.info("Fetched prod index")
197197
repo = ProjectRepository(out_dir)
198-
signal.signal(signal.SIGUSR1, lambda *_: repo.pending_items())
198+
if hasattr(signal, "SIGUSR1"):
199+
signal.signal(signal.SIGUSR1, lambda *_: repo.pending_items())
199200
loop = asyncio.get_running_loop()
200201
loop.call_later(60 * 10, schedule_pending_item_printer, repo)
201202
with kev("index projects"):

0 commit comments

Comments
 (0)