|
|
@@ -10,6 +10,7 @@ use Illuminate\Console\Scheduling\Schedule;
|
|
|
use Illuminate\Foundation\Application;
|
|
|
use Illuminate\Foundation\Configuration\Exceptions;
|
|
|
use Illuminate\Foundation\Configuration\Middleware;
|
|
|
+use Illuminate\Support\Facades\Log;
|
|
|
use Laravel\Sanctum\Http\Middleware\CheckForAnyAbility;
|
|
|
|
|
|
return Application::configure(basePath: dirname(__DIR__))
|
|
|
@@ -31,9 +32,19 @@ return Application::configure(basePath: dirname(__DIR__))
|
|
|
->withSchedule(function (Schedule $schedule) {
|
|
|
$schedule->call(new DeleteExpiredTokens)->everyMinute();
|
|
|
|
|
|
- $schedule->call(fn () => app(SendPushNotificationsTask::class)())->dailyAt('08:00');
|
|
|
- $schedule->call(fn () => app(SendPushNotificationsTask::class)())->dailyAt('13:00');
|
|
|
- $schedule->call(fn () => app(SendPushNotificationsTask::class)())->dailyAt('19:00');
|
|
|
+ $sendPushNotifications = function () {
|
|
|
+ try {
|
|
|
+ app(SendPushNotificationsTask::class)();
|
|
|
+ } catch (Throwable $e) {
|
|
|
+ Log::error('Falha ao resolver SendPushNotificationsTask: '.$e->getMessage(), [
|
|
|
+ 'exception' => $e,
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $schedule->call($sendPushNotifications)->dailyAt('08:00');
|
|
|
+ $schedule->call($sendPushNotifications)->dailyAt('13:00');
|
|
|
+ $schedule->call($sendPushNotifications)->dailyAt('19:00');
|
|
|
})
|
|
|
->withExceptions(function (Exceptions $exceptions) {
|
|
|
//
|