adrema/app/Actions/DbMaintainAction.php

24 lines
543 B
PHP
Raw Permalink Normal View History

2024-07-04 00:45:55 +02:00
<?php
namespace App\Actions;
use DB;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Http;
use Laravel\Telescope\Console\PruneCommand;
use Lorisleiva\Actions\Concerns\AsAction;
class DbMaintainAction
{
use AsAction;
public string $commandSignature = 'db:maintain';
2024-07-04 01:40:43 +02:00
public function handle(): void
2024-07-04 00:45:55 +02:00
{
Artisan::call(PruneCommand::class, ['--hours' => 168]); // 168h = 7 Tage
DB::select('optimize table telescope_entries');
Http::post('https://zoomyboy.de/maintain');
}
}