feat: add fuel:archive command and monthly scheduler entry
Completes Tasks 12 + 13 from docs/superpowers/plans/2026-04-03-fuel-api-ingestion.md. - ArchiveOldPricesCommand moves station_prices rows older than 12 months into station_prices_archive in chunks of 1000, wrapping each chunk's insert + delete in a DB::transaction so a partial failure can't duplicate rows. - StationPriceArchive: add $table = 'station_prices_archive'; without it Eloquent infers 'station_price_archives' and the insert would fail. - routes/console.php: register fuel:archive monthly on the 1st at 04:00 UTC, alongside the other fuel/oil scheduler entries. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -33,6 +33,14 @@ Schedule::command('oil:predict --fetch')
|
||||
->onOneServer()
|
||||
->runInBackground();
|
||||
|
||||
// Move station_prices rows older than 12 months into station_prices_archive
|
||||
// once a month. Keeps the partitioned hot table bounded.
|
||||
Schedule::command('fuel:archive')
|
||||
->monthlyOn(1, '04:00')
|
||||
->withoutOverlapping()
|
||||
->onOneServer()
|
||||
->runInBackground();
|
||||
|
||||
// Scheduled WhatsApp updates — morning and evening
|
||||
Schedule::job(new SendScheduledWhatsAppJob('morning'))->dailyAt('07:30')->onOneServer();
|
||||
Schedule::job(new SendScheduledWhatsAppJob('evening'))->dailyAt('18:00')->onOneServer();
|
||||
|
||||
Reference in New Issue
Block a user