blob: 717257a84ad36f998628be37575fbd5b61850b93 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
|