Commit 0a86f4b8 authored by Ahmad Sherif's avatar Ahmad Sherif

Merge branch 'improve-mirror-queries' into 'master'

Improve mirror queries

See merge request gitlab-org/gitlab-exporter!111
parents 415668fd 87beddc3
Pipeline #150006 passed with stage
in 53 seconds
......@@ -12,8 +12,13 @@ module GitLab
class RowCountCollector < Base
WHERE_MIRROR_ENABLED = <<~SQL.freeze
projects.mirror = true
AND projects.archived = false
AND project_mirror_data.retry_count <= 14
AND (projects.visibility_level = 20 OR plans.name IN ('early_adopter', 'bronze', 'silver', 'gold'))
AND (
(projects.visibility_level = 20 AND root_namespaces.visibility_level = 20)
OR
plans.name IN ('early_adopter', 'bronze', 'silver', 'gold')
)
SQL
MIRROR_QUERY = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment