Keep similar-ai from tripping the global circuit on a lone URL 502, clamp Qdrant search to 100, and add Server-Timing plus slow-request logging. Studio shared props, Academy S3 exists caching, heat chunking, and Redis/scheduler hygiene stay in this rollout.
45 lines
1.6 KiB
PHP
45 lines
1.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\CollectionBackgroundJobService;
|
|
use Illuminate\Console\Command;
|
|
|
|
class DispatchCollectionMaintenanceCommand extends Command
|
|
{
|
|
protected $signature = 'collections:dispatch-maintenance
|
|
{--health : Dispatch health and eligibility refresh jobs}
|
|
{--recommendations : Dispatch recommendation refresh jobs}
|
|
{--duplicates : Dispatch duplicate scan jobs}';
|
|
|
|
protected $description = 'Dispatch queued collection maintenance jobs for health, recommendation, and duplicate workflows.';
|
|
|
|
public function handle(CollectionBackgroundJobService $jobs): int
|
|
{
|
|
if (! (bool) config('collections.v5.queue.dispatch_enabled', false)) {
|
|
$this->warn('Collection maintenance dispatch is disabled (COLLECTIONS_V5_DISPATCH_ENABLED). No jobs queued.');
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
|
|
$runHealth = (bool) $this->option('health');
|
|
$runRecommendations = (bool) $this->option('recommendations');
|
|
$runDuplicates = (bool) $this->option('duplicates');
|
|
|
|
if (! $runHealth && ! $runRecommendations && ! $runDuplicates) {
|
|
$runHealth = true;
|
|
$runRecommendations = true;
|
|
$runDuplicates = true;
|
|
}
|
|
|
|
$summary = $jobs->dispatchScheduledMaintenance($runHealth, $runRecommendations, $runDuplicates);
|
|
|
|
foreach ($summary as $key => $payload) {
|
|
$this->info(sprintf('%s: %d queued.', ucfirst((string) $key), (int) ($payload['count'] ?? 0)));
|
|
}
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
} |