Skip to content

Commit

Permalink
Only write if we have events
Browse files Browse the repository at this point in the history
  • Loading branch information
inxilpro committed Nov 15, 2023
1 parent 5c96777 commit 089a405
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Lifecycle/EventStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public function read(
/** @param Event[] $events */
public function write(array $events): bool
{
if (empty($events)) {
return true;
}

$this->guardAgainstConcurrentWrites($events);

return VerbEvent::insert(static::formatForWrite($events))
Expand Down

0 comments on commit 089a405

Please sign in to comment.