From 25a6a4247713f67cfa3c3d896b8788d75fe8e274 Mon Sep 17 00:00:00 2001 From: Tomo Tsuyuki Date: Thu, 3 Mar 2022 17:16:52 +1100 Subject: [PATCH] MDL-74072 cachestore_redis: Add error check for envoy proxy --- cache/stores/redis/lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cache/stores/redis/lib.php b/cache/stores/redis/lib.php index 4ce7580ce63..8f80704f36f 100644 --- a/cache/stores/redis/lib.php +++ b/cache/stores/redis/lib.php @@ -680,7 +680,11 @@ class cachestore_redis extends cache_store implements cache_is_key_aware, cache_ * @return int|null Memory used by Redis or null if we don't know */ public function store_total_size(): ?int { - $details = $this->redis->info('MEMORY'); + try { + $details = $this->redis->info('MEMORY'); + } catch (\RedisException $e) { + return null; + } if (empty($details['used_memory'])) { return null; } else {