From 696d7fd299277f22c865cbf6e99b23bb79bc104a Mon Sep 17 00:00:00 2001 From: Axel <1597611+axeloz@users.noreply.github.com> Date: Mon, 20 Dec 2021 22:17:07 +0100 Subject: [PATCH] Trying to bugfix --- app/Console/Commands/RunMonitoring.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Console/Commands/RunMonitoring.php b/app/Console/Commands/RunMonitoring.php index 04404bf..47ce4a1 100644 --- a/app/Console/Commands/RunMonitoring.php +++ b/app/Console/Commands/RunMonitoring.php @@ -51,6 +51,7 @@ class RunMonitoring extends Command $rounds = $this->argument('rounds') ?? $this->rounds; // Getting pending tasks + try { $tasks = DB::table('tasks') ->where(function($query) { $query->whereRaw('DATE_SUB(now(), INTERVAL frequency SECOND) > last_execution'); @@ -61,6 +62,10 @@ class RunMonitoring extends Command ->take($rounds) ->get() ; + } + catch (Exception $e) { + echo 'ERROR : '.$e->getMessage(); + } if (is_null($tasks) || count($tasks) == 0) { $this->info('No task to process, going back to sleep');