Horizon fuer Live vorbereitet

- Supervisor bedient alle Queues der Jobs (high-priority, default, dhl-*),
  production mit 3 statt 10 Prozessen
- Redis-Queue mit after_commit: der Stripe-Paid-Pfad plant den
  Rechnungsnummer-Sync innerhalb der Transaktion ein
- /horizon nur fuer System-Admins (admin >= 4)
- horizon:snapshot alle 5 Minuten, queue:prune-failed nach 30 Tagen
- deploy.sh: QUEUE_WORKER (horizon | none), Anleitung Abschnitt F

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin 2026-10-07 10:32:26 +00:00
parent e1c6178bc7
commit 21daab259f
7 changed files with 95 additions and 25 deletions

View file

@ -98,6 +98,10 @@ class Kernel extends ConsoleKernel
// Cleanup old log files weekly (keeps logs for 30 days)
$schedule->command('logs:cleanup --days=30')->weekly()->sundays()->at('05:00');
// Horizon: Kennzahlen fuer das Dashboard, fehlgeschlagene Jobs nach 30 Tagen loeschen
$schedule->command('horizon:snapshot')->everyFiveMinutes();
$schedule->command('queue:prune-failed --hours=720')->dailyAt('05:15');
// DHL Tracking Update: Stündlich mit status-basierten Intervallen und Batch-API
$schedule->command('dhl:update-tracking --days=30 --send-emails')
->hourly()

View file

@ -27,10 +27,6 @@ class HorizonServiceProvider extends HorizonApplicationServiceProvider
*/
protected function gate(): void
{
Gate::define('viewHorizon', function ($user = null) {
return in_array(optional($user)->email, [
//
]);
});
Gate::define('viewHorizon', fn ($user = null): bool => (bool) $user?->isSySAdmin());
}
}