Skip to content

Commit

Permalink
Merge branch 'staging' into fix/unknown-field-response-for-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmartt authored Jul 9, 2024
2 parents aa38f22 + 7fe7dab commit f9fd83f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/jobs/cache/browser_channels/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def perform
else
Time.at(0).to_s
end

# Warm the cache to avoid 429/ thundering stampede
Rewards::Parameters.new.fetch_allowed_regions

if full_refresh_not_ran_recently?(all_prefixes_run_time: all_prefixes_run_time) && queue_depth_small?
run_all_prefixes
Rails.cache.write(LAST_RAN_ALL_KEY, Time.now.to_s)
Expand Down
2 changes: 1 addition & 1 deletion lib/rewards/parameters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_parameters
end

def get_cached_parameters
Rails.cache.fetch(RATES_CACHE_KEY, expires_in: 5.minutes) do
Rails.cache.fetch(RATES_CACHE_KEY, expires_in: 1.hour) do
get_parameters
end
end
Expand Down

0 comments on commit f9fd83f

Please sign in to comment.