mobileAppId; } /** @return array */ public function backoff(): array { return [60, 300, 900]; } /** @return array */ public function middleware(): array { return [(new RateLimited('cafe-bazaar-sync'))->releaseAfter(60)]; } /** * Execute the job. */ public function handle(SyncCafeBazaarAppAction $sync): void { $app = MobileApp::query()->find($this->mobileAppId); if ($app === null || (! $app->bazaar_sync_enabled && ! $this->force)) { return; } $sync->execute($app, $this->force); } public function failed(?Throwable $exception): void { MobileApp::query()->whereKey($this->mobileAppId)->update([ 'bazaar_sync_status' => 'failed', 'bazaar_last_synced_at' => now(), 'bazaar_sync_error' => $exception?->getMessage() ?? 'The Bazaar synchronization job failed.', ]); } }