authorize('dispatchArcadiaRefreshJob', FetchAndUpsertArcadiaEmployees::class); $uniqueLock = new UniqueLock($this->cacheRepository); if (! $uniqueLock->acquire($syncJob)) { $this->flashMessageService->warning(__('An employee sync is already in progress.')); return to_route('bo.dashboard'); } $this->dispatcher->dispatchAfterResponse($syncJob); $this->flashMessageService->success(__('The employee sync job has been dispatched')); return to_route('bo.dashboard'); } }