Skip to content

Commit

Permalink
chore: use chunks to save event logs for multiple changes at the same…
Browse files Browse the repository at this point in the history
… time
  • Loading branch information
shpran committed Oct 20, 2023
1 parent 2eddf5b commit b65d8b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions model/event/DacChangedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ public function __construct(array $added, array $removed)

public function getValues(): array
{
$added = array_chunk($this->added, 100);
$removed = array_chunk($this->removed, 100);

return array_merge(
$this->enrichWithActions($this->added, 'add'),
$this->enrichWithActions($this->removed, 'remove'),
$this->enrichWithActions($added, 'add'),
$this->enrichWithActions($removed, 'remove'),
);
}

Expand Down

0 comments on commit b65d8b4

Please sign in to comment.