Files
landing-api/routes/console.php
Josep Piguillem 773d3901c6 Warn about calls closing and content coming off the site
A dashboard widget lists what expires in the next two weeks, and a daily
command reminds whoever edits it a week and a day ahead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 10:16:24 +02:00

61 lines
1.9 KiB
PHP

<?php
declare(strict_types=1);
use App\Models\AuditLog;
use Illuminate\Support\Facades\Schedule;
/*
|--------------------------------------------------------------------------
| Scheduled tasks
|--------------------------------------------------------------------------
|
| Keeping repository stats fresh is what stops the public site from looking
| abandoned, which is the main risk for a site like this. `withoutOverlapping`
| guards against a slow run colliding with the next tick.
|
*/
/*
* Publication windows are enforced by the `published` scopes, so content
* appears and disappears on time whether or not this runs. What it does is
* keep the stored state honest — a call the site stopped offering weeks ago
* should not still say "Open" in the panel.
*/
Schedule::command('content:schedule')
->everyFiveMinutes()
->withoutOverlapping()
->runInBackground();
/*
* Safety net for image processing. Uploads queue their own work, but a worker
* that is down would otherwise leave images without dimensions indefinitely —
* and the symptom, a page that reflows as it loads, is easy to miss.
*/
Schedule::command('media:process')
->everyTenMinutes()
->withoutOverlapping()
->runInBackground();
Schedule::command('repos:sync')
->cron(match ($cron = (string) config('git.sync_cron', 'hourly')) {
'hourly' => '0 * * * *',
'daily' => '0 4 * * *',
default => $cron,
})
->withoutOverlapping()
->runInBackground();
// A week and a day before a call closes or content comes off the site, the
// people who could do something about it are told.
Schedule::command('content:expiring')
->dailyAt('08:00')
->withoutOverlapping();
// Old audit entries: they name people and the addresses they worked from, so
// they are kept for `audit.retention_days` and no longer.
Schedule::command('model:prune', ['--model' => [AuditLog::class]])
->daily()
->withoutOverlapping()
->runInBackground();