From 5be7a656774ae1a328feacb31955d7908300af4c Mon Sep 17 00:00:00 2001 From: Josh Salway Date: Wed, 22 Apr 2026 16:57:49 +1000 Subject: [PATCH] Tighten retry shape: $tries=1, $uniqueFor=600, drop $timeout and $backoff Most failures for these jobs are GitHub API rate-limit responses; retries inside the same window do not help, so one attempt is enough and $backoff has nothing to pace. $timeout would clip the intentionally throttled handle() loop (sleep(1) per app) below realistic workloads. Heavy users with 60+ apps would lose updates mid-cycle. The original code left $timeout unset, and `UpdateApps` is dispatched via `dispatchAfterResponse()` which doesn't go through `queue:work` at all (the queue $timeout is irrelevant in that path). Letting the operator's worker config govern is more honest. $uniqueFor reduced to 600 (10 min) since with $tries=1 + worker-governed timeout there is no long retry chain to outlive. Lock self-heals 10 minutes after a crashed worker. --- app/Jobs/ProcessApps.php | 17 ++++++----------- app/Jobs/UpdateApps.php | 23 ++++++++--------------- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/app/Jobs/ProcessApps.php b/app/Jobs/ProcessApps.php index 862a4bdb3..8cb16a15f 100644 --- a/app/Jobs/ProcessApps.php +++ b/app/Jobs/ProcessApps.php @@ -21,21 +21,16 @@ class ProcessApps implements ShouldQueue, ShouldBeUnique use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; /** - * Bound total attempts so a failed job stops after three retries across - * worker restarts, independent of the broker's reserved-job recovery path. + * Most failures here are GitHub rate-limit responses; retries inside the + * same window do not help, so a single attempt is enough. */ - public int $tries = 3; - - /** @var array seconds between retries */ - public array $backoff = [30, 60, 120]; - - public int $timeout = 60; + public int $tries = 1; /** - * Expire the ShouldBeUnique lock after 1 hour so a crashed worker does - * not permanently block future ProcessApps dispatches. + * Expire the ShouldBeUnique lock after 10 minutes so a crashed worker + * does not permanently block future ProcessApps dispatches. */ - public int $uniqueFor = 3600; + public int $uniqueFor = 600; /** * Create a new job instance. diff --git a/app/Jobs/UpdateApps.php b/app/Jobs/UpdateApps.php index 7911cc824..118844dab 100644 --- a/app/Jobs/UpdateApps.php +++ b/app/Jobs/UpdateApps.php @@ -19,25 +19,18 @@ class UpdateApps implements ShouldQueue, ShouldBeUnique use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; /** - * Bound total attempts so a failed job stops after three retries across - * worker restarts, independent of the broker's reserved-job recovery path. + * Most failures here are GitHub rate-limit responses; retries inside the + * same window do not help, so a single attempt is enough. The throttle + * loop in handle() means the job is intentionally long-running, so we + * leave $timeout unset and let the operator's worker config govern. */ - public int $tries = 3; - - /** @var array seconds between retries */ - public array $backoff = [30, 60, 120]; + public int $tries = 1; /** - * Per-attempt wall-clock ceiling. Heavy users with many apps may need - * a larger value; 60s covers the typical Heimdall deployment. + * Expire the ShouldBeUnique lock after 10 minutes so a crashed worker + * does not permanently block future UpdateApps dispatches. */ - public int $timeout = 60; - - /** - * Expire the ShouldBeUnique lock after 1 hour so a crashed worker does - * not permanently block future UpdateApps dispatches. - */ - public int $uniqueFor = 3600; + public int $uniqueFor = 600; /** * Create a new job instance.