Skip to content
代码片段 群组 项目
未验证 提交 efba7e01 编辑于 作者: Maxime Orefice's avatar Maxime Orefice 提交者: GitLab
浏览文件

Fix UpdateTableSizes keep

上级 265d31b1
No related branches found
No related tags found
2 合并请求!3031Merge per-main-jh to main-jh by luzhiyuan,!3030Merge per-main-jh to main-jh
......@@ -36,17 +36,17 @@ def each_change
def table_sizes
table_sizes = {}
active_connection = Gitlab::Database::SharedModel.connection
database_entries.each do |entry|
connection = Gitlab::Database.schemas_to_base_models[entry.gitlab_schema]&.first&.connection
next unless connection
next unless Gitlab::Database.db_config_name(connection) == Gitlab::Database.db_config_name(active_connection)
with_shared_connection(connection) do
table_size = Gitlab::Database::PostgresTableSize.by_table_name(entry.table_name)
next unless table_size
table_size = Gitlab::Database::PostgresTableSize.by_table_name(entry.table_name)
next unless table_size
table_sizes[table_size.table_name] = table_size.size_classification
end
table_sizes[table_size.table_name] = table_size.size_classification
end
table_sizes
......@@ -165,10 +165,6 @@ def change_identifiers
[self.class.name.demodulize, Date.current.iso8601, SecureRandom.alphanumeric]
end
def with_shared_connection(connection, &block)
Gitlab::Database::SharedModel.using_connection(connection, &block)
end
def reviewer(role)
roulette.random_reviewer_for(role)
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册