From f2d8650d36d228bb94fb84ef2a2e64c1dfc9b3a7 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 1 Sep 2023 23:47:29 +0000 Subject: [PATCH] Fix date time format calculation --- src/Model/Post/Engagement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Post/Engagement.php b/src/Model/Post/Engagement.php index 2d1f40b6c..48ce024d4 100644 --- a/src/Model/Post/Engagement.php +++ b/src/Model/Post/Engagement.php @@ -70,7 +70,7 @@ class Engagement return; } - if ($parent['created'] < DateTimeFormat::utc('now - ' . DI::config()->get('channel', 'engagement_hours') . ' 24 hour')) { + if ($parent['created'] < DateTimeFormat::utc('now - ' . DI::config()->get('channel', 'engagement_hours') . ' hour')) { Logger::debug('Post is too old', ['uri-id' => $item['uri-id'], 'parent-uri-id' => $item['parent-uri-id'], 'created' => $parent['created']]); return; } @@ -93,7 +93,7 @@ class Engagement public static function expire() { - DBA::delete('post-engagement', ["`created` < ?", DateTimeFormat::utc('now - ' . DI::config()->get('channel', 'engagement_hours') . ' 24 hour')]); + DBA::delete('post-engagement', ["`created` < ?", DateTimeFormat::utc('now - ' . DI::config()->get('channel', 'engagement_hours') . ' hour')]); Logger::notice('Cleared expired engagements', ['rows' => DBA::affectedRows()]); } }