执行代码

Adjustreact
daiao 5 years ago
parent 579177bff1
commit 7496098027

@ -51,18 +51,14 @@ namespace :subjects do
"'#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')") "'#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')")
puts "index: #{index}; worker_number: #{Parallel.worker_number}" puts "index: #{index}; worker_number: #{Parallel.worker_number}"
puts "####str: #{str}" puts "####str: #{str}"
if str.size == 50 end
sql = "REPLACE INTO subject_records(#{column_value}) VALUES #{str.uniq.join(",")}" if str.size > 0
puts sql sql = "REPLACE INTO subject_records(#{column_value}) VALUES #{str.uniq.join(",")}"
ActiveRecord::Base.connection.execute sql puts sql
end ActiveRecord::Base.connection.execute sql
end end
end end
# if str.size > 0
# sql = "REPLACE INTO subject_records(#{column_value}) VALUES #{str.uniq.join(",")}"
# puts sql
# ActiveRecord::Base.connection.execute sql
# end
puts("---------------------data_statistic_end") puts("---------------------data_statistic_end")
Rails.logger.info("---------------------data_statistic_end") Rails.logger.info("---------------------data_statistic_end")
end end

Loading…
Cancel
Save