Merge branch 'standalone_develop' into pre_trustie_server

This commit is contained in:
yystopf 2024-06-07 10:41:16 +08:00
commit 7df9bfd297
2 changed files with 6 additions and 5 deletions

View File

@ -147,6 +147,7 @@ module RepositoriesHelper
ss_href = content.to_s.scan(href_regex)
ss_href_1 = content.to_s.scan(href_regex_1)
total_sources = {ss_c: ss_c,ss: ss, ss_1: ss_1, ss_2: ss_2, ss_src: ss_src, ss_src_1: ss_src_1, ss_src_2: ss_src_2, ss_src_3: ss_src_3, ss_src_4: ss_src_4, ss_src_5: ss_src_5, ss_href: ss_href, ss_href_1: ss_href_1}
puts total_sources
# total_sources.uniq!
total_sources.except(:ss, :ss_c).each do |k, sources|
sources.each do |s|
@ -210,14 +211,14 @@ module RepositoriesHelper
end
end
after_ss_souces = content.to_s.scan(s_regex).uniq
after_ss_souces = content.to_s.scan(s_regex)#.uniq
after_ss_souces.each_with_index do |s, index|
next if total_sources[:ss][index].nil?
content = content.gsub("#{s[0]}","#{total_sources[:ss][index][0]}")
end
after_ss_c_souces = content.to_s.scan(s_regex_c).uniq
puts after_ss_c_souces
puts total_sources
after_ss_c_souces = content.to_s.scan(s_regex_c)#.uniq
after_ss_c_souces.each_with_index do |s, index|
next if total_sources[:ss_c][index].nil?
content = content.gsub("#{s[0]}","#{total_sources[:ss_c][index][0]}")
end
return content

View File

@ -12,7 +12,7 @@ class DailyPlatformStatisticsJob < ApplicationJob
ActiveJob::Base.logger.info "job baidu_tongji_auth access_token ===== #{access_token}"
# 从最后一个记录日期开始,如果遗漏日期数据可以补充数据
last_date = DailyPlatformStatistic.order(:date).last
start_date = last_date.date
start_date = last_date.present? ? last_date.date : 1.days.ago.beginning_of_day
end_date = Time.now
if access_token.present?
tongji_service.overview_batch_add(start_date, end_date)