When scheduled jobs like scheduleFullSubscriberSyncJob() detect that a job is already running or pending, they throw a controlled exception:
/src/Model/UseCase/ScheduleBackgroundJob.php
if (JobEntity::TYPE_PENDING === $job->getStatus()) {
throw new JobAlreadyScheduledException('Job is already scheduled.');
} else {
throw new JobAlreadyRunningException('Job is already running.');
}
These are expected cases but are currently logged as errors in all task handlers:
catch (\Throwable $e) {
$this->logger->error($e->getMessage());
}
Suggestion:
Log these specific exceptions as info instead:
catch (\Throwable $e) {
if (
$e instanceof JobAlreadyRunningException ||
$e instanceof JobAlreadyScheduledException
) {
$this->logger->info($e->getMessage());
} else {
$this->logger->error($e->getMessage());
}
}
This would reduce noise in logs without changing behavior.
When scheduled jobs like scheduleFullSubscriberSyncJob() detect that a job is already running or pending, they throw a controlled exception:
/src/Model/UseCase/ScheduleBackgroundJob.php
These are expected cases but are currently logged as errors in all task handlers:
Suggestion:
Log these specific exceptions as info instead:
This would reduce noise in logs without changing behavior.