Skip to content

Commit

Permalink
Log the correct place
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansick committed May 3, 2024
1 parent eda1609 commit 48e35d3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ select = ["ALL"]
"SLF001", # tests are allowed to access private members
"T201", # tests are allowed to use print
]
"src/noteburst/worker/main.py" = [
"PLR0915", # along a long function
]

[tool.ruff.lint.isort]
known-first-party = ["noteburst", "tests"]
Expand Down
18 changes: 13 additions & 5 deletions src/noteburst/worker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,19 @@ async def startup(ctx: dict[Any, Any]) -> None:
user = User(
username=identity.username, uid=identity.uid, gid=identity.gid
)
authed_user = await user.login(
scopes=config.parsed_worker_token_scopes,
http_client=http_client,
token_lifetime=config.worker_token_lifetime,
)
try:
authed_user = await user.login(
scopes=config.parsed_worker_token_scopes,
http_client=http_client,
token_lifetime=config.worker_token_lifetime,
)
except httpx.HTTPStatusError as e:
logger.exception(
"Error authenticating the worker's user",
body=e.response.json(),
status_code=e.response.status_code,
)
raise
logger.info("Authenticated the worker's user.")

jupyter_client = JupyterClient(
Expand Down

0 comments on commit 48e35d3

Please sign in to comment.