Add timeout for waiting watchdog observer thread to complete

This commit is contained in:
grossmj committed 2024-12-31 17:24:19 +07:00
1 parent 82779d816f
commit b39c7541fb
1 file changed
+1 -1
+1 -1
View File
@@ -214,7 +214,7 @@ async def monitor_images_on_filesystem(app: FastAPI):
# stop when the app is exiting
if app.state.exiting:
observer.stop()
observer.join()
observer.join(10)
log.info(f"Stopping monitoring for new images in '{path}'")
loop.call_soon_threadsafe(queue.put_nowait, None)
break