Skip to content

Commit

Permalink
Stop with the sleep + redirect since it can consume PG connections
Browse files Browse the repository at this point in the history
  • Loading branch information
dbackeus committed Jun 18, 2024
1 parent eb75d18 commit 1b9eccd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/controllers/configs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ def show
render plain: server.machine_config.generate_config
else
server.update!(last_configured_at: nil, last_request_for_configuration_at: Time.now)

sleep 15

attempt = params[:attempt] || 0
redirect_to get_config_path(attempt: attempt.to_i + 1)
render plain: "No configuration found for server with IP #{server.ip}", status: 420
end
end

Expand Down

0 comments on commit 1b9eccd

Please sign in to comment.