修改sync的部分问题
This commit is contained in:
parent
91cf27fc3c
commit
13499e4ad5
|
@ -6,16 +6,16 @@
|
|||
class SyncUserForgeTask
|
||||
def call
|
||||
Rails.logger.info("##########_______sync_start________###########")
|
||||
all_users = User.where("login is not null").first(1000)
|
||||
all_users = User.where("login is not null").first(100)
|
||||
# 这里再把所有用户循环
|
||||
all_users.each do |u|
|
||||
user_params = u.as_json
|
||||
user_extension_params = u.try(:user_extensions).as_json || []
|
||||
target_params = []
|
||||
user_projects = Project.where(user_id: u.id)
|
||||
user_projects = Project.includes(:versions,:repository,:project_score, issues: [:journals],owner: [:user_extensions], members: [roles: [:member_roles]]).where(user_id: u.id)
|
||||
|
||||
if user_projects.present?
|
||||
projects = user_projects.includes(:versions,:repository,:project_score, issues: [:journals],owner: [:user_extensions], members: [roles: [:member_roles]])
|
||||
projects.each do |p|
|
||||
user_projects.each do |p|
|
||||
identifier = p.try(:identifier)
|
||||
if p.repository.present? && p.repository.try(:identifier).present?
|
||||
identifier = p.repository.try(:identifier)
|
||||
|
|
Loading…
Reference in New Issue