final stage

This commit is contained in:
2026-06-01 16:11:29 +02:00
parent 5557650824
commit 3424c1c9f7
21 changed files with 5010 additions and 47 deletions
+18
View File
@@ -1,6 +1,8 @@
<?php
use Illuminate\Support\Facades\Schedule;
use App\Services\BackupService;
use App\Models\AppSetting;
Schedule::call(function () {
try {
@@ -10,3 +12,19 @@ Schedule::call(function () {
\Illuminate\Support\Facades\Log::error('Scheduled email sync failed', ['error' => $e->getMessage()]);
}
})->name('email:sync')->everyFifteenMinutes()->withoutOverlapping();
// Backup automatico
Schedule::call(function () {
if (!AppSetting::getSetting('backup_auto_enabled', false)) {
return;
}
try {
(new BackupService())->run();
} catch (\Exception $e) {
\Illuminate\Support\Facades\Log::error('Scheduled backup failed', ['error' => $e->getMessage()]);
}
})->name('backup:auto')
->dailyAt((string) (AppSetting::getSetting('backup_auto_hour', 3) . ':00'))
->withoutOverlapping()
->onOneServer();