mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:01:24 +00:00
27 lines
667 B
PHP
27 lines
667 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\AdminDashboardSnapshotService;
|
|
use Illuminate\Console\Command;
|
|
|
|
class WarmAdminDashboard extends Command
|
|
{
|
|
protected $signature = 'admin:warm-dashboard';
|
|
|
|
protected $description = 'Rebuild and re-cache the admin dashboard snapshot (Cache::flexible payload)';
|
|
|
|
public function handle(AdminDashboardSnapshotService $snapshot): int
|
|
{
|
|
$start = microtime(true);
|
|
$snapshot->warm();
|
|
$elapsed = (int) ((microtime(true) - $start) * 1000);
|
|
|
|
$this->info("Admin dashboard snapshot warmed in {$elapsed} ms.");
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|