Extract subject loading before automation processing loop
[MAILPOET-4946]
This commit is contained in:
@ -64,19 +64,19 @@ class TriggerHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ensure subjects are registered and loadable
|
||||||
$subjects = $this->subjectTransformerHandler->getAllSubjects($subjects);
|
$subjects = $this->subjectTransformerHandler->getAllSubjects($subjects);
|
||||||
|
$subjectEntries = $this->subjectLoader->getSubjectsEntries($subjects);
|
||||||
|
foreach ($subjectEntries as $entry) {
|
||||||
|
$entry->getPayload();
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($automations as $automation) {
|
foreach ($automations as $automation) {
|
||||||
$step = $automation->getTrigger($trigger->getKey());
|
$step = $automation->getTrigger($trigger->getKey());
|
||||||
if (!$step) {
|
if (!$step) {
|
||||||
throw Exceptions::automationTriggerNotFound($automation->getId(), $trigger->getKey());
|
throw Exceptions::automationTriggerNotFound($automation->getId(), $trigger->getKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure subjects are registered and loadable
|
|
||||||
$subjectEntries = $this->subjectLoader->getSubjectsEntries($subjects);
|
|
||||||
foreach ($subjectEntries as $entry) {
|
|
||||||
$entry->getPayload();
|
|
||||||
}
|
|
||||||
|
|
||||||
$automationRun = new AutomationRun($automation->getId(), $automation->getVersionId(), $trigger->getKey(), $subjects);
|
$automationRun = new AutomationRun($automation->getId(), $automation->getVersionId(), $trigger->getKey(), $subjects);
|
||||||
$stepRunArgs = new StepRunArgs($automation, $automationRun, $step, $subjectEntries);
|
$stepRunArgs = new StepRunArgs($automation, $automationRun, $step, $subjectEntries);
|
||||||
$createAutomationRun = $trigger->isTriggeredBy($stepRunArgs);
|
$createAutomationRun = $trigger->isTriggeredBy($stepRunArgs);
|
||||||
|
Reference in New Issue
Block a user