This commit is contained in:
sylor_huang@126.com 2020-07-15 22:39:32 +08:00
parent e478af2548
commit 7d8dd0babc
1 changed files with 30 additions and 20 deletions

View File

@ -210,28 +210,38 @@ class SyncForgeController < ApplicationController
SyncProjectsJob.perform_later(sync_projects_params, gitea_main)
end
else
if diff_issue_ids.size > 200
new_diff_ids = diff_issue_ids.in_groups_of(200).map{|k| k.reject(&:blank?)}
new_diff_ids.each_with_index do |diff, index|
sync_projects_params = {
type: "Issue",
ids: diff,
token: get_token,
parent_id: project_id
}
SyncLog.sync_log("***2--030#{idnex+1}. sync_projects_params_groups-#{sync_projects_params}--------------")
SyncProjectsJob.perform_later(sync_projects_params, gitea_main)
end
else
sync_projects_params = {
type: "Issue",
ids: diff_issue_ids,
token: get_token,
parent_id: project_id
}
end
# if diff_issue_ids.size > 200
# new_diff_ids = diff_issue_ids.in_groups_of(200).map{|k| k.reject(&:blank?)}
# new_diff_ids.each_with_index do |diff, index|
# sync_projects_params = {
# type: "Issue",
# ids: diff,
# token: get_token,
# parent_id: project_id
# }
# SyncLog.sync_log("***2--030#{idnex+1}. sync_projects_params_groups-#{sync_projects_params}--------------")
# SyncProjectsJob.perform_later(sync_projects_params, gitea_main)
# end
# else
# sync_projects_params = {
# type: "Issue",
# ids: diff_issue_ids,
# token: get_token,
# parent_id: project_id
# }
# SyncLog.sync_log("***2--03. sync_projects_params_groups-#{sync_projects_params}--------------")
# SyncProjectsJob.perform_later(sync_projects_params, gitea_main)
# end
sync_projects_params = {
type: "Issue",
ids: diff_issue_ids,
token: get_token,
parent_id: project_id
}
SyncLog.sync_log("***2--03. sync_projects_params_groups-#{sync_projects_params}--------------")
SyncProjectsJob.perform_later(sync_projects_params, gitea_main)
end
end