Skip to content

Commit

Permalink
Pool.php - add methods to clear finished/results cache (spatie#235)
Browse files Browse the repository at this point in the history
Since the member variables of finished/results keep growing indefinitely over time this is a source of a memory leak.
This memory leak is resolvable by clearing the result caches with the newly introduced methods.
  • Loading branch information
iasjennen authored Dec 9, 2024
1 parent c270e69 commit 59edea5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,15 @@ public function stop()
{
$this->stopped = true;
}

public function clearFinished()
{
$this->finished = [];
}

public function clearResults()
{
$this->results = [];
}

}

0 comments on commit 59edea5

Please sign in to comment.