diff --git a/src/Prometheus/Storage/Redis.php b/src/Prometheus/Storage/Redis.php index 122d11a..2763565 100644 --- a/src/Prometheus/Storage/Redis.php +++ b/src/Prometheus/Storage/Redis.php @@ -536,7 +536,11 @@ private function collectSummaries(): array } if (count($samples) === 0) { - $this->redis->del($valueKey); + try { + $this->redis->del($valueKey); + } catch (\RedisException $e) { + // ignore if we can't delete the key + } continue; } @@ -571,7 +575,11 @@ private function collectSummaries(): array if (count($data['samples']) > 0) { $summaries[] = $data; } else { - $this->redis->del($metaKey); + try { + $this->redis->del($metaKey); + } catch (\RedisException $e) { + // ignore if we can't delete the key + } } } return $summaries;