Commit 9c1a10f1 authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'log-unlink-errors' into 'master'

Add error logging for Redis UNLINK failures

See merge request gitlab-org/gitlab!29032
parents 78ba46d2 2e0a2be9
......@@ -64,7 +64,9 @@ module Gitlab
else
redis.del(*keys)
end
rescue ::Redis::CommandError
rescue ::Redis::CommandError => e
Gitlab::ErrorTracking.log_exception(e)
redis.del(*keys)
end
end
......
......@@ -103,6 +103,12 @@ describe Gitlab::RepositorySetCache, :clean_gitlab_redis_cache do
expect(cache.expire(:foo)).to eq(1)
expect(cache.read(:foo)).to be_empty
end
it 'logs the failure' do
expect(Gitlab::ErrorTracking).to receive(:log_exception)
cache.expire(:foo)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment