Keep cover orders pending until colleague sts 2/4/6 via callback or 35s poll. Nightly prices:prune also drops old log tables. Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
680 B
PHP
26 lines
680 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\DatabaseLogPruneService;
|
|
use App\Services\PriceSnapshotService;
|
|
use Illuminate\Console\Command;
|
|
|
|
class PrunePriceSnapshotsCommand extends Command
|
|
{
|
|
protected $signature = 'prices:prune';
|
|
|
|
protected $description = 'Nightly prune: price history + bloating logs (31-day retention)';
|
|
|
|
public function handle(PriceSnapshotService $snapshots, DatabaseLogPruneService $logs): int
|
|
{
|
|
$stats = [
|
|
'prices' => $snapshots->pruneHistory(),
|
|
'logs' => $logs->pruneHistory(),
|
|
];
|
|
$this->info(json_encode($stats, JSON_UNESCAPED_UNICODE));
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|