Check if a wiki can be updated on a node with project restrictions

parent e67b3ce8
......@@ -8,8 +8,18 @@ module Geo
def execute
@projects.each do |project|
next unless can_update?(project['id'])
GeoWikiRepositoryUpdateWorker.perform_async(project['id'], project['clone_url'])
end
end
private
def can_update?(project_id)
return true if Gitlab::Geo.current_node&.restricted_project_ids.nil?
Gitlab::Geo.current_node.restricted_project_ids.include?(project_id)
end
end
end
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