Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit a8071fa

Browse files
committed
New: provide worker name for better debug
1 parent 1aacaea commit a8071fa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bookserver/routers/books.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import os.path
1616
import posixpath
1717
import random
18+
import socket
1819
from typing import Optional
1920

2021
# Third-party imports
@@ -304,6 +305,7 @@ async def serve_page(
304305
show_rs_banner = False
305306
rslogger.debug(f"After user check rs_banner is {show_rs_banner}")
306307

308+
worker_name = os.environ.get("WORKER_NAME", socket.gethostname())
307309
# temporary
308310
if course_attrs.get("ad_server", "google") == "ethical":
309311
serve_google_ad = False
@@ -331,6 +333,7 @@ async def serve_page(
331333
canonical_host=canonical_host,
332334
show_rs_banner=show_rs_banner,
333335
show_ethical_ad=serve_ad,
336+
worker_name=worker_name,
334337
**course_attrs,
335338
)
336339
# See `templates <https://fastapi.tiangolo.com/advanced/templates/>`_.

0 commit comments

Comments
 (0)