This commit is contained in:
BoHung Chiu 2023-05-08 10:11:01 +08:00
parent 0132cb6cde
commit 17b385d427
1 changed files with 8 additions and 1 deletions

View File

@ -384,9 +384,16 @@ namespace :sync_asia_personal_plugins do
members = MemberProfile.where(:id.in=>member_ids).to_a
else
members = MemberProfile.where(:email=>/@asia\.edu\.tw$/).to_a
members += MemberProfile.where(:id.in=> User.where(:member_profile_id.nin=> members.map(&:id)).pluck(:member_profile_id)).to_a
end
members.each do |member|
user_id = AsiaSyncPlugin.user_id(member)
user_id = AsiaSyncPlugin.user_id(member) rescue nil
if user_id.blank?
user_id = member.user.user_name rescue nil
if user_id.nil?
next
end
end
puts "Fetching data for #{user_id}..."
query_result = get_sync_data(user_id)
#puts ["query_result",query_result]