diff --git a/lib/Service/AssignmentsService.php b/lib/Service/AssignmentsService.php index 8525f823..82095488 100644 --- a/lib/Service/AssignmentsService.php +++ b/lib/Service/AssignmentsService.php @@ -118,6 +118,10 @@ public function scheduleAssignmentRun(?string $userId, int $assignmentId): void } catch (MultipleObjectsReturnedException $e) { throw new InternalException(previous: $e); } + if ($session->getAgencyPendingActions() !== null) { + $this->logger->debug('Skipping assignment run as the last run still has pending actions'); + return; + } $assignment = $this->assignmentMapper->find($userId, $assignmentId); $assignment->setLastRunAt($this->timeFactory->now()->getTimestamp()); $this->assignmentMapper->update($assignment);