Skip to content

Commit f2103b2

Browse files
Update DatabaseEntriesRepository.php
1 parent 1f47307 commit f2103b2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Storage/DatabaseEntriesRepository.php

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Laravel\Telescope\EntryResult;
1414
use Laravel\Telescope\EntryType;
1515
use Laravel\Telescope\IncomingEntry;
16+
use Illuminate\Support\Sleep;
1617

1718
class DatabaseEntriesRepository implements Contract, ClearableRepository, PrunableRepository, TerminableRepository
1819
{
@@ -360,6 +361,8 @@ public function prune(DateTimeInterface $before)
360361
do {
361362
$deleted = $query->take($this->chunkSize)->delete();
362363

364+
Sleep::for(1)->second();
365+
363366
$totalDeleted += $deleted;
364367
} while ($deleted !== 0);
365368

@@ -375,10 +378,14 @@ public function clear()
375378
{
376379
do {
377380
$deleted = $this->table('telescope_entries')->take($this->chunkSize)->delete();
381+
382+
Sleep::for(1)->second();
378383
} while ($deleted !== 0);
379384

380385
do {
381386
$deleted = $this->table('telescope_monitoring')->take($this->chunkSize)->delete();
387+
388+
Sleep::for(1)->second();
382389
} while ($deleted !== 0);
383390
}
384391

0 commit comments

Comments
 (0)