Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDJ Mountney <david@twkie.net>2016-04-22 19:50:08 +0300
committerDJ Mountney <david@twkie.net>2016-05-10 18:24:09 +0300
commit67dc3b9c1131b5a7f3f861a0fe35169fda5cd398 (patch)
treea4a37993a86465f24a9160134ae737c8fded14ed /config
parent98d8e3fe9ff4d120469378490c41381ae751597e (diff)
Add the health_check gem end expose the health_check route
Diffstat (limited to 'config')
-rw-r--r--config/initializers/health_check.rb28
-rw-r--r--config/routes.rb3
2 files changed, 31 insertions, 0 deletions
diff --git a/config/initializers/health_check.rb b/config/initializers/health_check.rb
new file mode 100644
index 00000000000..c111cfdf5ce
--- /dev/null
+++ b/config/initializers/health_check.rb
@@ -0,0 +1,28 @@
+# HealthCheck.setup do |config|
+# # Text output upon success
+# config.success = 'success'
+#
+# # Timeout in seconds used when checking smtp server
+# config.smtp_timeout = 30.0
+#
+# # http status code used when plain text error message is output
+# # Set to 200 if you want your want to distinguish between partial (text does not include success) and
+# # total failure of rails application (http status of 500 etc)
+# config.http_status_for_error_text = 500
+#
+# # http status code used when an error object is output (json or xml)
+# # Set to 200 if you want your want to distinguish between partial (healthy property == false) and
+# # total failure of rails application (http status of 500 etc)
+# config.http_status_for_error_object = 500
+#
+# # You can customize which checks happen on a standard health check
+# config.standard_checks = [ 'database', 'migrations', 'custom' ]
+#
+# # You can set what tests are run with the 'full' or 'all' parameter
+# config.full_checks = ['database', 'migrations', 'custom', 'email', 'cache']
+#
+# # Add one or more custom checks that return a blank string if ok, or an error message if there is an error
+# config.add_custom_check do
+# any code that returns blank on success and non blank string upon failure
+# end
+# end
diff --git a/config/routes.rb b/config/routes.rb
index dafecc94648..cac800b9a9c 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -73,6 +73,9 @@ Rails.application.routes.draw do
mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq
end
+ # Health check
+ health_check_routes
+
# Enable Grack support
mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post, :put]