Skip to content

Commit

Permalink
Rubocop and SD route bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
thesecretmaster committed Mar 18, 2019
1 parent b2bab68 commit a74cb0b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Expand Up @@ -90,7 +90,7 @@ def redis_log_request
request.set_header 'redis_logs.log_key', redis_log_key
request.set_header 'redis_logs.timestamp', @request_time
request.set_header 'redis_logs.request_id', request.uuid
unless session[:redis_log_id].present? || is_smokey_route?
unless session[:redis_log_id].present? || smokey_route?
session[:redis_log_id] = SecureRandom.base64
session[:redis_log_id] = SecureRandom.base64 while redis.exists("session/#{session[:redis_log_id]}")
end
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/redis_log_job.rb
Expand Up @@ -9,7 +9,7 @@ class RedisLogJob < ApplicationJob
begin
i.to_yaml
rescue
""
''
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion config/initializers/redis_logging.rb
Expand Up @@ -4,7 +4,9 @@

REDIS_LOG_EXPIRATION = 1.day.seconds.to_i

def log_timestamps(ts, status:, action:, controller:, format:, method:, view_runtime:, db_runtime:, path:, uuid:) # rubocop:disable Metrics/ParameterLists
# rubocop:disable Metrics/ParameterLists
def log_timestamps(ts, status:, action:, controller:, format:, method:, view_runtime:, db_runtime:, path:, uuid:)
# rubocop:enable Metrics/ParameterLists
redis = redis(logger: true)
return if path.nil?
path = Rails.sensible_routes.match_for(path)&.path || path.split('?').first
Expand Down

0 comments on commit a74cb0b

Please sign in to comment.