about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2021-04-03 02:39:04 +0200
committerStarfall <us@starfall.systems>2021-04-11 12:17:56 -0500
commitec2bab4b78d638a5a8c6a6a525b176776685f59c (patch)
tree5d76e1ffa2bc2ac27206a86e0a9a0cceb58578cc
parent845f959cb80647a44c90735ca45dd11ccc348f8f (diff)
Change health check (#15988)
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock9
-rw-r--r--app/controllers/health_controller.rb7
-rw-r--r--config/initializers/health_check.rb8
-rw-r--r--config/routes.rb2
5 files changed, 8 insertions, 19 deletions
diff --git a/Gemfile b/Gemfile
index 8a77c1bf6..c866625c0 100644
--- a/Gemfile
+++ b/Gemfile
@@ -54,7 +54,6 @@ gem 'fast_blank', '~> 1.0'
 gem 'fastimage'
 gem 'hiredis', '~> 0.6'
 gem 'redis-namespace', '~> 1.8'
-gem 'health_check', git: 'https://github.com/ianheggie/health_check', ref: '0b799ead604f900ed50685e9b2d469cd2befba5b'
 gem 'htmlentities', '~> 4.3'
 gem 'http', '~> 4.4'
 gem 'http_accept_language', '~> 2.1'
diff --git a/Gemfile.lock b/Gemfile.lock
index 9fc70e175..2841af2d9 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -22,14 +22,6 @@ GIT
       statsd-ruby (~> 1.4, >= 1.4.0)
 
 GIT
-  remote: https://github.com/ianheggie/health_check
-  revision: 0b799ead604f900ed50685e9b2d469cd2befba5b
-  ref: 0b799ead604f900ed50685e9b2d469cd2befba5b
-  specs:
-    health_check (4.0.0.pre)
-      rails (>= 4.0)
-
-GIT
   remote: https://github.com/nsommer/pluck_each
   revision: 73be0947c52fc54bf6d7085378db008358aac5eb
   ref: 73be0947c52fc54bf6d7085378db008358aac5eb
@@ -756,7 +748,6 @@ DEPENDENCIES
   fog-openstack (~> 0.3)
   fuubar (~> 2.5)
   hamlit-rails (~> 0.2)
-  health_check!
   hiredis (~> 0.6)
   htmlentities (~> 4.3)
   http (~> 4.4)
diff --git a/app/controllers/health_controller.rb b/app/controllers/health_controller.rb
new file mode 100644
index 000000000..2a22a0557
--- /dev/null
+++ b/app/controllers/health_controller.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class HealthController < ActionController::Base
+  def show
+    render plain: 'OK'
+  end
+end
diff --git a/config/initializers/health_check.rb b/config/initializers/health_check.rb
deleted file mode 100644
index 6f1e78fed..000000000
--- a/config/initializers/health_check.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-HealthCheck.setup do |config|
-  config.uri = 'health'
-
-  config.standard_checks = %w(database migrations cache)
-  config.full_checks = %w(database migrations cache)
-  
-  config.include_error_in_response_body = false
-end
diff --git a/config/routes.rb b/config/routes.rb
index 6814dc61e..8ec67113b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -10,7 +10,7 @@ Rails.application.routes.draw do
 
   mount LetterOpenerWeb::Engine, at: 'letter_opener' if Rails.env.development?
 
-  health_check_routes
+  get 'health', to: 'health#show'
 
   authenticate :user, lambda { |u| u.admin? } do
     mount Sidekiq::Web, at: 'sidekiq', as: :sidekiq