Skip to content

Commit

Permalink
Set arq timeouts for check runs
Browse files Browse the repository at this point in the history
We want these check runs to be slightly longer than the configuration so
that the worker's code has a change to report the timeout before arq
kills the job itself and we lose the opportunity to report the check run
as failed to GitHub.
  • Loading branch information
jonathansick committed Sep 6, 2024
1 parent 22cd5cd commit 2d8ff1f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/timessquare/worker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from collections.abc import Callable
from typing import Any, ClassVar

import arq
import httpx
import structlog
from safir.dependencies.db_session import db_session_dependency
Expand Down Expand Up @@ -125,8 +126,15 @@ class WorkerSettings:
repo_removed,
pull_request_sync,
compute_check_run,
create_check_run,
create_rerequested_check_run,
# Make the check run timeouts slightly longer than the configured
# timeout so we can handle the timeout gracefully inside the worker
arq.worker.func(
create_check_run, timeout=config.github_checkrun_timeout + 30.0
),
arq.worker.func(
create_rerequested_check_run,
timeout=config.github_checkrun_timeout + 30.0,
),
replace_nbhtml,
]

Expand Down

0 comments on commit 2d8ff1f

Please sign in to comment.