forge/app/Console/Commands/SptVersionModCountsCommand.php
Refringe 16e3a67efd
Query Optimization
- Download counts were taking too long to calculate dynamically, so we're keeping track of a total count with observers and queued job.
- Optimized the SQL used to order a mod listing by mod version update times.
2024-08-31 01:19:22 -04:00

21 lines
477 B
PHP

<?php
namespace App\Console\Commands;
use App\Jobs\SptVersionModCountsJob;
use Illuminate\Console\Command;
class SptVersionModCountsCommand extends Command
{
protected $signature = 'app:count-mods';
protected $description = 'Recalculate the mod counts for each SPT version';
public function handle(): void
{
SptVersionModCountsJob::dispatch()->onQueue('default');
$this->info('SptVersionModCountsJob has been added to the queue');
}
}