From 384645eebd51a7ca17586a0c8a4b5cb5336728f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20Ioni=C8=9B=C4=83?= Date: Sun, 24 Nov 2024 07:41:47 +0200 Subject: [PATCH] fix: referendum job (#82) --- .../ReferendumBucuresti241124/Turnouts/FetchTurnoutsJob.php | 1 + app/Jobs/SchedulableJob.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/app/Jobs/ReferendumBucuresti241124/Turnouts/FetchTurnoutsJob.php b/app/Jobs/ReferendumBucuresti241124/Turnouts/FetchTurnoutsJob.php index 6aa34ec..24854f5 100644 --- a/app/Jobs/ReferendumBucuresti241124/Turnouts/FetchTurnoutsJob.php +++ b/app/Jobs/ReferendumBucuresti241124/Turnouts/FetchTurnoutsJob.php @@ -68,6 +68,7 @@ public function execute(): void Bus::batch([new ImportTurnoutsJob($this->scheduledJob, County::find(403))]) ->catch($persistAndClean) + ->then($persistAndClean) ->then(fn () => UpdateElectionTurnoutsTimestamp::dispatch($electionId)) ->name("$electionName / Prezență / $time") ->allowFailures() diff --git a/app/Jobs/SchedulableJob.php b/app/Jobs/SchedulableJob.php index 0c483e3..ec2535f 100644 --- a/app/Jobs/SchedulableJob.php +++ b/app/Jobs/SchedulableJob.php @@ -42,4 +42,9 @@ final public function handle(): void $this->scheduledJob->touch('last_run_at'); } + + public function uniqueId(): string + { + return "scheduled-job:{$this->scheduledJob->id}"; + } }