From 9b63720128c244ec61865e611f09f27101ee9709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Tue, 29 Oct 2024 23:04:48 +0100 Subject: [PATCH] Update RedisTrait.php --- src/Dashboards/Redis/RedisTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dashboards/Redis/RedisTrait.php b/src/Dashboards/Redis/RedisTrait.php index 35ee8f6..a23ceb3 100644 --- a/src/Dashboards/Redis/RedisTrait.php +++ b/src/Dashboards/Redis/RedisTrait.php @@ -42,7 +42,7 @@ private function panels(): string { $used_memory = (int) $info['memory']['used_memory']; $max_memory = (int) $info['memory']['maxmemory']; - $memory_usage = round(($used_memory / $max_memory) * 100, 2); + $memory_usage = $max_memory > 0 ? round(($used_memory / $max_memory) * 100, 2) : 0; $panels = [ [