diff --git a/lib/tasks/public_course_sync.rake b/lib/tasks/public_course_sync.rake index 928cd9113..caa207c52 100644 --- a/lib/tasks/public_course_sync.rake +++ b/lib/tasks/public_course_sync.rake @@ -1,5 +1,5 @@ #coding=utf-8 -# 执行示例 bundle exec rake public_course:student args=149,2903 +# 执行示例 RAILS_ENV=production bundle exec rake public_classes:student args=3,3056,'2019-03-01','2019-03-31',10,1 # args 第一个参数是subject_id,第二个参数是课程course_id # 第一期时间:2018-12-16 至2019-03-31 # 第二期时间:2019-04-07 至2019-07-28 @@ -22,10 +22,13 @@ namespace :public_classes do task :student => :environment do puts "subject_id is #{subject_id}" puts "course_id is #{course_id}" + puts "start time is #{start_time}" + puts "end time is #{end_time}" + puts "limt is #{limit}" - user_ids = Myshixun.find_by_sql("select distinct(user_id) from myshixuns where created_at between #{start_time} and #{end_time} and shixun_id in (select shixun_id from stage_shixuns + user_ids = Myshixun.find_by_sql("select distinct(user_id) from myshixuns where created_at between '#{start_time}' and '#{end_time}' and shixun_id in (select shixun_id from stage_shixuns where stage_id in (select id from stages where subject_id=#{subject_id})) limit #{limit}").map(&:user_id) - puts user_ids + puts "user_ids count is #{user_ids.count}" if user_ids.present? user_ids.each do |user_id| puts user_id diff --git a/public/react/src/modules/page/component/WebSSHTimer.js b/public/react/src/modules/page/component/WebSSHTimer.js index b1e67f0be..844c29785 100644 --- a/public/react/src/modules/page/component/WebSSHTimer.js +++ b/public/react/src/modules/page/component/WebSSHTimer.js @@ -145,6 +145,9 @@ class WebSSHTimer extends Component { } // 重置命令行的时候调用的接口,会删pod closeWebssh = (callback) => { + // 先关socket + this.closeWebsshSocket() + const { game } = this.props; // const url = `/api/v1/games/${game.identifier}/close_webssh` const url = `/tasks/${game.identifier}/close_webssh.json`