Skip to content

Commit 07df145

Browse files
committed
IcingaRedis: Do not fail while fetching last heartbeat
fixes #1372
1 parent b1dabef commit 07df145

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

library/Icingadb/Common/IcingaRedis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public static function getLastIcingaHeartbeat(?Redis $redis = null)
188188
$rs = $redis->xread(1, null, [$stream], '0');
189189

190190
if (is_array($rs)) {
191-
$timestampKeyPos = array_search('timestamp', $rs[$stream][0][1], true);
191+
$timestampKeyPos = array_search('timestamp', $rs[$stream][0][1] ?? [], true);
192192

193193
if ($timestampKeyPos !== false && isset($rs[$stream][0][1][$timestampKeyPos + 1])) {
194194
return $rs[$stream][0][1][$timestampKeyPos + 1] / 1000;

0 commit comments

Comments
 (0)