Skip to content

Commit

Permalink
Add Worker max priority
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jun 6, 2024
1 parent b2ad543 commit 099e976
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions github_app_geo_project/scripts/process_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
class _JobInfo(NamedTuple):
module: str
event_name: str
priority: int
repository: str
priority: int
worker_max_priority: int


_RUNNING_JOBS: dict[int, _JobInfo] = {}
Expand Down Expand Up @@ -666,7 +667,9 @@ async def _process_one_job(
message.title = f"Start process job '{job.event_name}' id: {job.id}, on {job.owner}/{job.repository} on module: {job.module}, on application {job.application}"
root_logger.addHandler(handler)
_LOGGER.info(message)
_RUNNING_JOBS[job.id] = _JobInfo(job.module or "-", job.event_name, job.priority, job.repository)
_RUNNING_JOBS[job.id] = _JobInfo(
job.module or "-", job.event_name, job.repository, job.priority, max_priority
)
root_logger.removeHandler(handler)

if make_pending:
Expand Down Expand Up @@ -802,7 +805,9 @@ async def _watch_dog() -> None:
with open("/watch_dog", "w", encoding="utf-8") as file_:
file_.write(datetime.datetime.now().isoformat())
for id_, job in _RUNNING_JOBS.items():
file_.write(f"{id_}: {job.module} {job.event_name} {job.repository} [{job.priority}]\n")
file_.write(
f"{id_}: {job.module} {job.event_name} {job.repository} [{job.priority}] (Worker max priority {job.worker_max_priority})\n"
)
await asyncio.sleep(60)


Expand Down

0 comments on commit 099e976

Please sign in to comment.