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