diff options
Diffstat (limited to 'src/EventRunner.php')
-rw-r--r-- | src/EventRunner.php | 6 |
1 files changed, 4 insertions, 2 deletions
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)]); } } } |