Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

Adjustreact
杨树明 6 years ago
commit afd79a1075

@ -23,23 +23,23 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名 # 所有请求必须合法签名
def check_sign def check_sign
# if !Rails.env.development? if !Rails.env.development?
# Rails.logger.info("66666 #{params}") Rails.logger.info("66666 #{params}")
# # suffix = request.url.split(".").last.split("?").first # suffix = request.url.split(".").last.split("?").first
# # suffix_arr = ["xls", "xlsx", "pdf", "zip"] # excel文件先注释 # suffix_arr = ["xls", "xlsx", "pdf", "zip"] # excel文件先注释
# # unless suffix_arr.include?(suffix) # unless suffix_arr.include?(suffix)
# if params[:client_key].present? if params[:client_key].present?
# randomcode = params[:randomcode] randomcode = params[:randomcode]
# # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5) # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
#
# sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}") sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
# Rails.logger.info("2222 #{sign}") Rails.logger.info("2222 #{sign}")
# tip_exception(501, "请求不合理") if sign != params[:client_key] tip_exception(501, "请求不合理") if sign != params[:client_key]
# else else
# tip_exception(501, "请求不合理") tip_exception(501, "请求不合理")
# end end
# # end # end
# end end
end end
# 全局配置参数 # 全局配置参数

@ -9,8 +9,8 @@ namespace :subjects do
buffer_size = 0 buffer_size = 0
column_value = "subject_id, study_count, course_study_count, initiative_study, passed_count, course_used_count, " + column_value = "subject_id, study_count, course_study_count, initiative_study, passed_count, course_used_count, " +
"school_used_count, created_at, updated_at" "school_used_count, created_at, updated_at"
subjects.find_in_batches(batch_size: 50) do |s, index| subjects.find_in_batches(batch_size: 50) do |s|
Parallel.each_with_index(s, in_processes: 4) do |subject| Parallel.each_with_index(s, in_processes: 4) do |subject, index|
puts("---------------------data_statistic: #{subject.id}") puts("---------------------data_statistic: #{subject.id}")
Rails.logger.info("---------------------data_statistic: #{subject.id}") Rails.logger.info("---------------------data_statistic: #{subject.id}")
data = Subjects::DataStatisticService.new(subject) data = Subjects::DataStatisticService.new(subject)

Loading…
Cancel
Save