diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-07-10 22:26:47 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-07-10 22:26:47 +0300 |
commit | 0ab89d8e36ba58a95244b4c6dd49d53fac7a699f (patch) | |
tree | 40707956c6a5942b6301b18b2e85e5336fa590c3 /lib/gitlab/reference_counter.rb | |
parent | 82503745143faf2b71185c9f392dbfd00d6d587e (diff) |
Add a rubocop for Rails.logger
Suggests to use a JSON structured log instead
Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/54102
Diffstat (limited to 'lib/gitlab/reference_counter.rb')
-rw-r--r-- | lib/gitlab/reference_counter.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/reference_counter.rb b/lib/gitlab/reference_counter.rb index d2dbc6f5ef5..1c43de35816 100644 --- a/lib/gitlab/reference_counter.rb +++ b/lib/gitlab/reference_counter.rb @@ -22,6 +22,7 @@ module Gitlab end end + # rubocop:disable Gitlab/RailsLogger def decrease redis_cmd do |redis| current_value = redis.decr(key) @@ -32,6 +33,7 @@ module Gitlab end end end + # rubocop:enable Gitlab/RailsLogger private @@ -39,7 +41,7 @@ module Gitlab Gitlab::Redis::SharedState.with { |redis| yield(redis) } true rescue => e - Rails.logger.warn("GitLab: An unexpected error occurred in writing to Redis: #{e}") + Rails.logger.warn("GitLab: An unexpected error occurred in writing to Redis: #{e}") # rubocop:disable Gitlab/RailsLogger false end end |