From 05d0bb7c1af6d27fee5e7b99ca90c438880d234b Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 22 Jun 2019 17:09:21 +0800 Subject: [PATCH] fix bug --- app/controllers/zips_controller.rb | 2 +- app/services/exercise_user_pdf_service.rb | 6 +++--- app/services/export_exercises_service.rb | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/controllers/zips_controller.rb b/app/controllers/zips_controller.rb index 3e3445e77..b04ee3cb1 100644 --- a/app/controllers/zips_controller.rb +++ b/app/controllers/zips_controller.rb @@ -21,7 +21,7 @@ class ZipsController < ApplicationController file_name = filename_for_content_disposition(exercises.filename) send_file exercises.ex_zip, filename: file_name, type: 'application/zip' - logger.info("##################_______________________file_name___________1100101010010__________###########") + Rails.logger.info("##################_______________________file_name___________1100101010010__________###########") rescue Exception => e normal_status(-1, e.message) diff --git a/app/services/exercise_user_pdf_service.rb b/app/services/exercise_user_pdf_service.rb index 52f54163e..1f2f84414 100644 --- a/app/services/exercise_user_pdf_service.rb +++ b/app/services/exercise_user_pdf_service.rb @@ -41,13 +41,13 @@ class ExerciseUserPdfService # aa = File.open(Rails.root.join("public/123.html"),"w+") # aa.syswrite(kit.source) #正式需删掉------- - logger.info("##################_______________________file_name___________5555555555__________###########") + Rails.logger.info("##################_______________________file_name___________5555555555__________###########") file = Tempfile.new(filename) - logger.info("##################_______________________file_name___________66666666__________###########") + Rails.logger.info("##################_______________________file_name___________66666666__________###########") kit.to_pdf(file.path) - logger.info("##################_______________________file_name___________7777777777__________###########") + Rails.logger.info("##################_______________________file_name___________7777777777__________###########") file end diff --git a/app/services/export_exercises_service.rb b/app/services/export_exercises_service.rb index 4b7b10b9b..c450f6247 100644 --- a/app/services/export_exercises_service.rb +++ b/app/services/export_exercises_service.rb @@ -14,28 +14,28 @@ class ExportExercisesService end def ex_zip - logger.info("##################_______________________file_name___________11111__________###########") + Rails.logger.info("##################_______________________file_name___________11111__________###########") zip_file = Tempfile.new(filename) - logger.info("##################_______________________file_name___________2222222__________###########") + Rails.logger.info("##################_______________________file_name___________2222222__________###########") pdfs = [] Zip::File.open(zip_file.path, Zip::File::CREATE) do |zip| - logger.info("##################_______________________file_name___________3333333__________###########") + Rails.logger.info("##################_______________________file_name___________3333333__________###########") ex_users.each do |ex_user| export = ExerciseUserPdfService.new(exercise, ex_user) - logger.info("##################_______________________file_name___________444444__________###########") + Rails.logger.info("##################_______________________file_name___________444444__________###########") pdf = export.ex_pdf - logger.info("##################_______________________file_name___________888888888__________###########") + Rails.logger.info("##################_______________________file_name___________888888888__________###########") pdfs << pdf - logger.info("##################_______________________file_name___________999999999__________###########") + Rails.logger.info("##################_______________________file_name___________999999999__________###########") begin zip.add(export.filename, pdf.path) - logger.info("##################_______________________file_name___________10000000000000__________###########") + Rails.logger.info("##################_______________________file_name___________10000000000000__________###########") rescue => ex Rails.logger.error(ex.message)