Suffix message class with 'Message' and add check on workflow to assert no transitions were applied since message placed in queue

This commit is contained in:
2024-08-28 11:52:01 +02:00
committed by Julien Fastré
parent 5d84e997c1
commit cb446edd18
5 changed files with 43 additions and 21 deletions

View File

@@ -54,8 +54,8 @@ class CancelStaleWorkflowCronJob implements CronJobInterface
foreach ($staleWorkflowIds as $wId) {
try {
$this->messageBus->dispatch(new CancelStaleWorkflow($wId));
$lastCanceled = $wId;
$this->messageBus->dispatch(new CancelStaleWorkflowMessage($wId));
$lastCanceled = max($wId, $lastCanceled);
++$processedCount;
} catch (\Exception $e) {
$this->logger->error("Failed to dispatch CancelStaleWorkflow for ID {$wId}", ['exception' => $e]);