Suppress repetitive "missing cache key ping:events:XX" when there are no upcoming events

This commit is contained in:
Hypolite Petovan 2022-10-19 09:17:28 -04:00
parent ae6d67ed1f
commit 979e226d27

View file

@ -161,9 +161,7 @@ class Ping extends BaseModule
$ev = DBA::selectToArray('event', ['type', 'start'],
["`uid` = ? AND `start` < ? AND `finish` > ? AND NOT `ignore`",
Session::getLocalUser(), DateTimeFormat::utc('now + 7 days'), DateTimeFormat::utcNow()]);
if (DBA::isResult($ev)) {
DI::cache()->set($cachekey, $ev, Duration::HOUR);
}
DI::cache()->set($cachekey, $ev, Duration::HOUR);
}
if (DBA::isResult($ev)) {