fix: address review comments

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2025-10-20 13:43:40 +02:00
parent 6a1501a7d6
commit 7f15598083

View file

@ -981,12 +981,22 @@ class Manager implements IManager {
try {
if (!$this->taskMapper->hasRunningTasksForTaskType($task->getTaskTypeId())) {
// If no tasks are currently running for this task type, nudge the provider to ask for tasks
$provider->trigger();
try {
$provider->trigger();
} catch (\Throwable $e) {
$this->logger->error('Failed to trigger the provider after scheduling a task.', [
'exception' => $e,
'taskId' => $task->getId(),
'providerId' => $provider->getId(),
]);
}
}
} catch (Exception $e) {
$this->logger->error('Failed to check DB for running tasks after a task was scheduled for a triggerable provider. Not triggering the provider.', ['exception' => $e]);
} catch (\Throwable $e) {
$this->logger->error('Failed to trigger the provider after scheduling a task.', ['exception' => $e]);
$this->logger->error('Failed to check DB for running tasks after a task was scheduled for a triggerable provider. Not triggering the provider.', [
'exception' => $e,
'taskId' => $task->getId(),
'providerId' => $provider->getId()
]);
}
}
}