From 68d37f6db8132d0728014e2e9789886f0c2e8029 Mon Sep 17 00:00:00 2001 From: Axel <1597611+axeloz@users.noreply.github.com> Date: Mon, 20 Dec 2021 22:57:45 +0100 Subject: [PATCH] Fixing time --- app/Console/Commands/RunMonitoring.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/RunMonitoring.php b/app/Console/Commands/RunMonitoring.php index a04887c..756dc93 100644 --- a/app/Console/Commands/RunMonitoring.php +++ b/app/Console/Commands/RunMonitoring.php @@ -47,20 +47,23 @@ class RunMonitoring extends Command */ public function handle() { + $n = DB::select('select now()'); + dd($n); $count = 0; $rounds = $this->argument('rounds') ?? $this->rounds; // Getting pending tasks $tasks = DB::table('tasks') ->where(function($query) { - $query->whereRaw('DATE_SUB('.time().', INTERVAL frequency SECOND) > last_execution'); + $query->whereRaw('DATE_SUB(NOW(), INTERVAL frequency SECOND) > last_execution'); $query->orWhereNull('last_execution'); }) ->where('active', 1) ->orderBy('last_execution', 'ASC') ->take($rounds) - ->get() + //->get() ; + dd($tasks->toSql()); if (is_null($tasks) || count($tasks) == 0) { $this->info('No task to process, going back to sleep');