Skip to content

Commit

Permalink
fix: clear all entries using chunks (#1415)
Browse files Browse the repository at this point in the history
* clear all entries using chunks

* fix code styling issues

* fix style issue

* formatting

---------

Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
skrskr and taylorotwell authored Dec 5, 2023
1 parent 8c6591a commit dc52d2e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Storage/DatabaseEntriesRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,13 @@ public function prune(DateTimeInterface $before)
*/
public function clear()
{
$this->table('telescope_entries')->delete();
$this->table('telescope_monitoring')->delete();
do {
$deleted = $this->table('telescope_entries')->take($this->chunkSize)->delete();
} while ($deleted !== 0);

do {
$deleted = $this->table('telescope_monitoring')->take($this->chunkSize)->delete();
} while ($deleted !== 0);
}

/**
Expand Down

0 comments on commit dc52d2e

Please sign in to comment.