Skip to content

Commit 2b2c01e

Browse files
Push the metric before re-enque the task (#2984)
Push the metric before re-enque the task Reviewed-by: gemini-code-assist[bot] Reviewed-by: Nikola Forró
2 parents dcb239e + 4bfcdbb commit 2b2c01e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packit_service/worker/handlers/abstract.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,9 @@ def check_rate_limit_remaining(self) -> None:
548548
)
549549
# Increment the metric for tasks enqueued to the rate-limited queue
550550
self.pushgateway.rate_limited_tasks_enqueued.inc()
551+
# Push metrics immediately since we're about to raise an exception
552+
# that will prevent the normal push() call in run_job()
553+
self.pushgateway.push()
551554
# Use apply_async to reschedule the task to the rate-limited queue
552555
# retry() isn't working, the chosen queue is the one defined in the task definition,
553556
# not the one passed to retry()

0 commit comments

Comments
 (0)