move into sonardesk

This commit is contained in:
Mark Gregory
2026-10-12 14:50:13 +01:00
parent 5f0d2ceb72
commit 38b4a7406f
879 changed files with 24021 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace Modules\AI\Console;
use Illuminate\Console\Command;
use Modules\AI\Models\AIExecution;
final class PruneAIExecutions extends Command
{
protected $signature = 'ai:prune {--days=}';
protected $description = 'Remove old AI execution records.';
public function handle(): int
{
$days = (int) ($this->option('days') ?: config('ai.retain_executions_days', 90));
$count = AIExecution::where('created_at', '<', now()->subDays($days))->delete();
$this->info("Deleted {$count} AI executions.");
return self::SUCCESS;
}
}