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 'lib/gitlab/database/health_status/context.rb')
-rw-r--r--lib/gitlab/database/health_status/context.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/gitlab/database/health_status/context.rb b/lib/gitlab/database/health_status/context.rb
new file mode 100644
index 00000000000..717257a84ad
--- /dev/null
+++ b/lib/gitlab/database/health_status/context.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Database
+ module HealthStatus
+ class Context
+ attr_reader :status_checker, :connection, :tables, :gitlab_schema
+
+ # status_checker: the caller object which checks for database health status
+ # eg: BackgroundMigration::BatchedMigration or DeferJobs::DatabaseHealthStatusChecker
+ def initialize(status_checker, connection, tables, gitlab_schema)
+ @status_checker = status_checker
+ @connection = connection
+ @tables = tables
+ @gitlab_schema = gitlab_schema
+ end
+
+ def status_checker_info
+ {
+ status_checker_id: status_checker.id,
+ status_checker_type: status_checker.class.name,
+ job_class_name: status_checker.job_class_name
+ }
+ end
+ end
+ end
+ end
+end