Skip to content

Commit

Permalink
Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nbudin committed Nov 7, 2024
1 parent 8bb4c0f commit a6328fa
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions app/services/autoscale_servers_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,11 @@ def self.apply_throttle_for_target(target, start_time, time)
# we're in the pre-signup phase, always have redundant instances ready
MIN_INSTANCES_FOR_SIGNUP_OPENING
end
elsif time >= start_time + SIGNUP_OPENING_DECAY_TIME
MIN_INSTANCES_FOR_SIGNUP_OPENING
else
if time >= start_time + SIGNUP_OPENING_DECAY_TIME
MIN_INSTANCES_FOR_SIGNUP_OPENING
else
decay_amount = (time - start_time) / SIGNUP_OPENING_DECAY_TIME
smooth_decay(decay_amount, target, MIN_INSTANCES_FOR_SIGNUP_OPENING)
end
decay_amount = (time - start_time) / SIGNUP_OPENING_DECAY_TIME
smooth_decay(decay_amount, target, MIN_INSTANCES_FOR_SIGNUP_OPENING)
end
end

Expand All @@ -91,7 +89,7 @@ def self.scaling_target_for(time)
apply_throttle_for_target(target, start_time, time)
end

[[MIN_INSTANCES, *scaling_targets].max, MAX_INSTANCES].min.ceil
scaling_targets.max.clamp(MIN_INSTANCES, MAX_INSTANCES).ceil
end

private
Expand Down

0 comments on commit a6328fa

Please sign in to comment.