From 84dbbc42fe1d6131e9fe7101a5ff1089003b949d Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Fri, 19 Jul 2019 23:15:17 +0800 Subject: [PATCH] =?UTF-8?q?logger=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/course_board_message_count.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tasks/course_board_message_count.rake b/lib/tasks/course_board_message_count.rake index 49f33c615..bd85d7ede 100644 --- a/lib/tasks/course_board_message_count.rake +++ b/lib/tasks/course_board_message_count.rake @@ -2,7 +2,7 @@ namespace :course_board do desc 'transfer children message to root message board' task children_message_transfer: :environment do Board.find_each do |board| - logger("Current transfer board id: #{board.id} ~") + Rails.logger.info("Current transfer board id: #{board.id} ~") root_subquery = board.messages.where(parent_id: nil).reorder(nil).pluck(:id) if root_subquery.present? @@ -16,14 +16,14 @@ namespace :course_board do end Board.reset_counters(board.id, :messages) - logger("transfer success ~") + Rails.logger.info("transfer success ~") end end desc 'transfer root id && statistic descendants count' task messages_descendants_count_transfer: :environment do Message.root_nodes.find_each do |root| - logger("Current transfer root id: #{root.id} ~") + Rails.logger.info("Current transfer root id: #{root.id} ~") children_ids = root.children.pluck(:id) next if children_ids.blank? @@ -33,7 +33,7 @@ namespace :course_board do Message.where(id: ids).update_all(root_id: root.id) Message.reset_counters(root.id, :descendants) - logger("transfer success ~") + Rails.logger.info("transfer success ~") end end