Skip to content

Commit 1a85292

Browse files
committed
fix: address already in use and improve logging format
1 parent 9eb19d4 commit 1a85292

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

backend/workers/broker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
@broker.on_event(TaskiqEvents.WORKER_STARTUP)
3434
async def start_metrics_server(_state: Any) -> None:
3535
if settings.START_METRICS:
36-
start_http_server(settings.METRICS_PORT)
36+
try:
37+
start_http_server(settings.METRICS_PORT)
38+
except OSError:
39+
pass # Port already bound (e.g. container restart with --workers > 1)
3740

3841

3942
# Initialise the scheduler with label and Redis sources

0 commit comments

Comments
 (0)