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
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers/diagnostic_reports.rb')
-rw-r--r--config/initializers/diagnostic_reports.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/config/initializers/diagnostic_reports.rb b/config/initializers/diagnostic_reports.rb
new file mode 100644
index 00000000000..b9932822a0b
--- /dev/null
+++ b/config/initializers/diagnostic_reports.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+return unless Gitlab::Utils.to_boolean(ENV['GITLAB_DIAGNOSTIC_REPORTS_ENABLED'])
+
+# Any actions beyond this check should only execute outside of tests,
+# when running in application context (i.e. not in the Rails console or rspec)
+return unless Gitlab::Runtime.application?
+
+Gitlab::Cluster::LifecycleEvents.on_worker_start do
+ Gitlab::Memory::ReportsDaemon.instance.start
+end