diff --git a/lib/tasks/exercise_publish.rake b/lib/tasks/exercise_publish.rake index 13ae8c484..de93b3861 100644 --- a/lib/tasks/exercise_publish.rake +++ b/lib/tasks/exercise_publish.rake @@ -3,6 +3,8 @@ namespace :exercise_publish do desc "publish exercise and end exercise" task :publish => :environment do + Rails.logger.info("log--------------------------------exercise_publish start") + puts "--------------------------------exercise_publish start" exercises = Exercise.where("publish_time is not null and exercise_status = 1 and publish_time <=?",Time.now) exercises.each do |exercise| exercise.update_column('exercise_status', 2) @@ -11,6 +13,8 @@ namespace :exercise_publish do exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2) end end + Rails.logger.info("log--------------------------------exercise_publish end") + puts "--------------------------------exercise_publish end" end task :end => :environment do diff --git a/lib/tasks/gitlab.rake b/lib/tasks/gitlab.rake index 9328f5389..7893195ac 100644 --- a/lib/tasks/gitlab.rake +++ b/lib/tasks/gitlab.rake @@ -3,7 +3,6 @@ require 'trustie/gitlab/sync' namespace :gitlab do namespace :sync do desc "sync users to gitlab" - Rails.logger.info("--------------------------------sync users to gitlab") task :users => :environment do # User.where(username: 'root').find_each do |user| s = Trustie::Gitlab::Sync.new diff --git a/lib/tasks/homework_evaluation.rake b/lib/tasks/homework_evaluation.rake index 448137441..dc0dec270 100644 --- a/lib/tasks/homework_evaluation.rake +++ b/lib/tasks/homework_evaluation.rake @@ -8,6 +8,8 @@ namespace :homework_evaluation do end #自动开启匿评的任务 task :start_evaluation => :environment do + Rails.logger.info("log--------------------------------start_evaluation start") + puts "--------------------------------start_evaluation start" homework_detail_manuals = HomeworkDetailManual.where("evaluation_start = '#{Date.today}'") homework_detail_manuals.each do |homework_detail_manual| homework_common = homework_detail_manual.homework_common @@ -67,6 +69,9 @@ namespace :homework_evaluation do end end end + + Rails.logger.info("log--------------------------------start_evaluation end") + puts "--------------------------------start_evaluation end" end #自动关闭匿评的任务 diff --git a/lib/tasks/homework_publishtime.rake b/lib/tasks/homework_publishtime.rake index df996ab9e..dac3c11af 100644 --- a/lib/tasks/homework_publishtime.rake +++ b/lib/tasks/homework_publishtime.rake @@ -42,6 +42,8 @@ namespace :homework_publishtime do end task :end => :environment do + puts "--------------------------------homework_publish_end start" + Rails.logger.info("log--------------------------------homework_publish_end start") homework_commons = HomeworkCommon.where("end_time = '#{Date.today}'") homework_commons.each do |homework| if homework.anonymous_comment == 1 @@ -51,5 +53,7 @@ namespace :homework_publishtime do end end end + Rails.logger.info("log--------------------------------homework_publish_end end") + puts "--------------------------------homework_publish_end end" end end \ No newline at end of file