Skip to content

Commit

Permalink
Fix error in specs with Rails 8.0
Browse files Browse the repository at this point in the history
-:results => [{:message => "", :name => "Database", :status => "OK"}, {:message => "different values (now: 1990-01-01 00:00:00 +0000, fetched: false)", :name => "Redis", :status => "ERROR"}],
+:results => [{:message => "", :name => "Database", :status => "OK"}, {:message => "different values (now: Mon, 01 Jan 1990 00:00:00 +0000, fetched: false)", :name => "Redis", :status => "ERROR"}],

Rails 7.2 => Time.now.to_formatted_s(:rfc2822) => 1990-01-01 00:00:00 +0100
Rails 8.0 => Time.now.to_formatted_s(:rfc2822) => Mon, 01 Jan 1990 00:00:00 +0100

Rails 7.2 => Time.now => 1990-01-01 00:00:00 +0100
Rails 8.0 => Time.now => 1990-01-01 00:00:00 +0100
  • Loading branch information
n-rodriguez committed Nov 8, 2024
1 parent c7c05a5 commit 6edaa90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/health_monitor/providers/redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ def redis_connection
end

def check_values!
time = Time.now.to_formatted_s(:rfc2822)
time = Time.now

@redis.set(@key, time)
fetched = @redis.get(@key)

raise "different values (now: #{time}, fetched: #{fetched})" if fetched != time
raise "different values (now: #{time}, fetched: #{fetched})" if fetched != time.to_s
end

def check_max_used_memory!
Expand Down

0 comments on commit 6edaa90

Please sign in to comment.