Gustavo Zanatta пре 8 часа
родитељ
комит
610ebcb1d9
2 измењених фајлова са 16 додато и 5 уклоњено
  1. 14 3
      bootstrap/app.php
  2. 2 2
      config/firebase.php

+ 14 - 3
bootstrap/app.php

@@ -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) {
         //

+ 2 - 2
config/firebase.php

@@ -9,7 +9,7 @@ return [
      * ------------------------------------------------------------------------
      */
 
-    'default' => env('FIREBASE_PROJECT', 'app'),
+    'default' => env('FIREBASE_PROJECT', 'diariaappsfp'),
 
     /*
      * ------------------------------------------------------------------------
@@ -18,7 +18,7 @@ return [
      */
 
     'projects' => [
-        'app' => [
+        'diariaappsfp' => [
 
             /*
              * ------------------------------------------------------------------------