Skip to content
代码片段 群组 项目
提交 bb68df56 编辑于 作者: Kamil Trzciński's avatar Kamil Trzciński
浏览文件

Merge branch '300003-pages-migration-threads-fail-sometimes' into 'master'

Fix pages migration threads

See merge request gitlab-org/gitlab!52571
No related branches found
No related tags found
无相关合并请求
...@@ -11,5 +11,5 @@ class ProjectPagesMetadatum < ApplicationRecord ...@@ -11,5 +11,5 @@ class ProjectPagesMetadatum < ApplicationRecord
scope :deployed, -> { where(deployed: true) } scope :deployed, -> { where(deployed: true) }
scope :only_on_legacy_storage, -> { deployed.where(pages_deployment: nil) } scope :only_on_legacy_storage, -> { deployed.where(pages_deployment: nil) }
scope :with_project_route_and_deployment, -> { preload(project: [:namespace, :route, pages_metadatum: :pages_deployment]) } scope :with_project_route_and_deployment, -> { preload(:pages_deployment, project: [:namespace, :route]) }
end end
...@@ -32,8 +32,10 @@ def execute ...@@ -32,8 +32,10 @@ def execute
def start_migration_threads def start_migration_threads
Array.new(@migration_threads) do Array.new(@migration_threads) do
Thread.new do Thread.new do
while batch = @queue.pop Rails.application.executor.wrap do
process_batch(batch) while batch = @queue.pop
process_batch(batch)
end
end end
end end
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册