From fc70107aa3663eb1dd39b7607fd08598a608a29e Mon Sep 17 00:00:00 2001 From: philipp lang Date: Thu, 4 Jul 2024 00:45:55 +0200 Subject: [PATCH] Optimize telescope table when pruning --- app/Actions/DbMaintainAction.php | 23 +++++++++++++++++++++++ app/Console/Kernel.php | 5 +++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 app/Actions/DbMaintainAction.php diff --git a/app/Actions/DbMaintainAction.php b/app/Actions/DbMaintainAction.php new file mode 100644 index 00000000..45e3f8fc --- /dev/null +++ b/app/Actions/DbMaintainAction.php @@ -0,0 +1,23 @@ + 168]); // 168h = 7 Tage + DB::select('optimize table telescope_entries'); + Http::post('https://zoomyboy.de/maintain'); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a85a22d8..2fe7629d 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -2,11 +2,11 @@ namespace App\Console; +use App\Actions\DbMaintainAction; use App\Initialize\InitializeMembers; use App\Invoice\Actions\InvoiceSendAction; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; -use Laravel\Telescope\Console\PruneCommand; class Kernel extends ConsoleKernel { @@ -18,6 +18,7 @@ class Kernel extends ConsoleKernel protected $commands = [ InvoiceSendAction::class, InitializeMembers::class, + DbMaintainAction::class, ]; /** @@ -27,7 +28,7 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { - $schedule->command(PruneCommand::class, ['--hours' => 168])->daily(); // 168h = 7 Tage + $schedule->command(DbMaintainAction::class)->daily(); $schedule->command(InitializeMembers::class)->dailyAt('03:00'); }