From 1b9eccdbcacac779d17c9d13f755d0a52b67ac7d Mon Sep 17 00:00:00 2001 From: David Backeus Date: Tue, 18 Jun 2024 12:19:47 +0200 Subject: [PATCH] Stop with the sleep + redirect since it can consume PG connections --- app/controllers/configs_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/configs_controller.rb b/app/controllers/configs_controller.rb index d06d0da..0e9c2d8 100644 --- a/app/controllers/configs_controller.rb +++ b/app/controllers/configs_controller.rb @@ -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