From 94a3dd52da3ae180af37c6fd0e8c24b3562da388 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 4 Oct 2023 11:32:04 +0200 Subject: initial commit 2 --- src/EventRunner.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/EventRunner.php') diff --git a/src/EventRunner.php b/src/EventRunner.php index d2f1589..4f3bce9 100644 --- a/src/EventRunner.php +++ b/src/EventRunner.php @@ -16,6 +16,8 @@ class EventRunner { public function __construct() { + // Events + $results = DB::query('select * from events where time < now()')->fetchAll(); foreach ($results as $row) { @@ -79,8 +81,8 @@ class EventRunner } DB::query('delete from system where key=:key', ['key' => 'last_resource_tick']); - $value = (new \DateTime((new \DateTime())->format('Y-m-d H:i')))->format('c'); - DB::query('insert into system (key,value) VALUES (:key,:value)', ['key' => 'last_resource_tick', 'value' => json_encode($value)]); + $lastResourceTickMinute = (new \DateTime((new \DateTime())->format('Y-m-d H:i')))->format('c'); + DB::query('insert into system (key,value) VALUES (:key,:value)', ['key' => 'last_resource_tick', 'value' => json_encode($lastResourceTickMinute)]); } } } -- cgit v1.2.3