*/ public array $backoff = [60, 600]; public function __construct(public Repository $repository) {} /** * @return array */ public function middleware(): array { // A manual "sync now" and the hourly schedule can easily coincide. return [(new WithoutOverlapping((string) $this->repository->id))->dontRelease()]; } public function handle(GitManager $git): void { try { $git->sync($this->repository); } catch (GitException $e) { Log::warning('Repository sync failed', [ 'repository' => $this->repository->full_name, 'provider' => $this->repository->provider->value, 'message' => $e->getMessage(), ]); // A deleted or renamed repository will never succeed, so stop // retrying. The failure is already recorded on the model and shown // in the panel. if (! $e->isTransient) { $this->fail($e); return; } throw $e; } } }