Skip to content

Commit

Permalink
Merge pull request #467 from amalrails/use_load_multiplier
Browse files Browse the repository at this point in the history
SL: 93, #464 use load multiplier to calculate load
  • Loading branch information
kepstin authored Mar 1, 2021
2 parents 6646f82 + 3859a7b commit 8aecbee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tasks/poll.rake
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ namespace :poll do

if server.online
# Update the load if the server is currently online
server.load = total_attendees
server.load = total_attendees * (server.load_multiplier.nil? ? 1.0 : server.load_multiplier.to_d)
else
# Only bring the server online if the number of successful requests is >= the acceptable threshold
next if server.increment_healthy < Rails.configuration.x.server_healthy_threshold

Rails.logger.info("Server id=#{server.id} is healthy. Bringing back online...")
server.reset_counters
server.load = total_attendees
server.load = total_attendees * (server.load_multiplier.nil? ? 1.0 : server.load_multiplier.to_d)
server.online = true
end
rescue StandardError => e
Expand Down

0 comments on commit 8aecbee

Please sign in to comment.