From 04ab22ca8ea930a57a45ce95e27f167c90e9687c Mon Sep 17 00:00:00 2001 From: Dmitry Bachinin Date: Wed, 10 Jul 2024 13:10:19 +0200 Subject: [PATCH] Update redis_store.rb --- lib/mini_profiler/storage/redis_store.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/mini_profiler/storage/redis_store.rb b/lib/mini_profiler/storage/redis_store.rb index 7f286905..d9395925 100644 --- a/lib/mini_profiler/storage/redis_store.rb +++ b/lib/mini_profiler/storage/redis_store.rb @@ -233,12 +233,13 @@ def fetch_snapshots_group(group_name) snapshots = [] corrupt_snapshots = [] redis.hgetall(group_hash_key).each do |id, bytes| - # rubocop:disable Security/MarshalLoad - snapshots << Marshal.load(bytes) - # rubocop:enable Security/MarshalLoad - rescue - corrupt_snapshots << id - end + begin + # rubocop:disable Security/MarshalLoad + snapshots << Marshal.load(bytes) + # rubocop:enable Security/MarshalLoad + rescue + corrupt_snapshots << id + end if corrupt_snapshots.size > 0 cleanup_corrupt_snapshots(corrupt_snapshots, group_name) end