Skip to content

Commit

Permalink
improve batch processing in projectionist
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBadura committed Mar 3, 2024
1 parent f898567 commit 7b543d6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Projection/Projectionist/DefaultProjectionist.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ function ($projections) use ($limit): void {
}
}
} finally {
foreach ($projections as $projection) {
$this->projectionStore->update($projection);
}

$stream?->close();
}

Expand Down Expand Up @@ -263,6 +267,10 @@ function (array $projections) use ($limit): void {
}
}
} finally {
foreach ($projections as $projection) {
$this->projectionStore->update($projection);
}

$stream?->close();
}

Expand Down Expand Up @@ -547,7 +555,6 @@ private function handleMessage(int $index, Message $message, Projection $project

if ($subscribeMethods === []) {
$projection->changePosition($index);
$this->projectionStore->update($projection);

$this->logger?->debug(
sprintf(
Expand Down Expand Up @@ -583,7 +590,6 @@ private function handleMessage(int $index, Message $message, Projection $project

$projection->changePosition($index);
$projection->resetRetry();
$this->projectionStore->update($projection);

$this->logger?->debug(
sprintf(
Expand Down

0 comments on commit 7b543d6

Please sign in to comment.