chang
This commit is contained in:
commit
1e96ecd440
|
@ -47,10 +47,10 @@ class SyncProjectsJob < ApplicationJob
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_target(target_jsons, target_type)
|
def create_target(target_jsons, target_type)
|
||||||
begin
|
|
||||||
SyncLog.sync_log("***【#{target_type}】. begin_to_create_target---------------")
|
SyncLog.sync_log("***【#{target_type}】. begin_to_create_target---------------")
|
||||||
return SyncLog.sync_log("*** no target_jsons") if target_jsons.blank?
|
return SyncLog.sync_log("*** no target_jsons") if target_jsons.blank?
|
||||||
target_jsons.each_with_index do |re,index|
|
target_jsons.each_with_index do |re,index|
|
||||||
|
begin
|
||||||
SyncLog.sync_log("***user_login:#{re[:user_login]}----target_type:#{target_type}-----#{index+1}")
|
SyncLog.sync_log("***user_login:#{re[:user_login]}----target_type:#{target_type}-----#{index+1}")
|
||||||
if re[:target_params].present?
|
if re[:target_params].present?
|
||||||
SyncLog.sync_log("***user_login:#{re[:user_login]}----target_type:#{target_type}")
|
SyncLog.sync_log("***user_login:#{re[:user_login]}----target_type:#{target_type}")
|
||||||
|
@ -107,17 +107,20 @@ class SyncProjectsJob < ApplicationJob
|
||||||
SyncLog.sync_log("***【#{target_type}】. create_failed---or has_exists---------------")
|
SyncLog.sync_log("***【#{target_type}】. create_failed---or has_exists---------------")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
SyncLog.sync_log("***111222. end_to_create_target---------------")
|
SyncLog.sync_log("***111222. end_to_create_target---------------")
|
||||||
rescue => e
|
rescue => e
|
||||||
SyncLog.sync_log("=========***【#{target_type}】creat_had_erros:#{e}===================")
|
SyncLog.sync_log("=========***【#{target_type}】creat_had_erros:#{e}===================")
|
||||||
|
next
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
def create_journals(target_jsons, target_type,issue_id)
|
def create_journals(target_jsons, target_type,issue_id)
|
||||||
SyncLog.sync_log("***【#{target_type}】. begin_to_create_target---------------")
|
SyncLog.sync_log("***【#{target_type}】. begin_to_create_target---------------")
|
||||||
return SyncLog.sync_log("*** no target_jsons") if target_jsons.blank?
|
return SyncLog.sync_log("*** no target_jsons") if target_jsons.blank?
|
||||||
target_jsons.each_with_index do |re,index|
|
target_jsons.each_with_index do |re,index|
|
||||||
|
begin
|
||||||
SyncLog.sync_log("***user_login:#{re[:user_login]}----target_type:#{target_type}-----#{index+1}")
|
SyncLog.sync_log("***user_login:#{re[:user_login]}----target_type:#{target_type}-----#{index+1}")
|
||||||
if re[:target_params].present?
|
if re[:target_params].present?
|
||||||
u_id = User.select(:id, :login).where(login: re[:user_login]).pluck(:id).first
|
u_id = User.select(:id, :login).where(login: re[:user_login]).pluck(:id).first
|
||||||
|
@ -137,9 +140,15 @@ class SyncProjectsJob < ApplicationJob
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
SyncLog.sync_log("***111222. journal_create failed---------------")
|
SyncLog.sync_log("***111222. journal_create failed---------------")
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
rescue => e
|
||||||
|
SyncLog.sync_log("***111222. journal_create failed---#{e}------------")
|
||||||
|
next
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
SyncLog.sync_log("***111222. end_to_create_journal---------------")
|
SyncLog.sync_log("***111222. end_to_create_journal---------------")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue