From fa3b216e0f1ad020e0f1384523fe7f15e5cfeed4 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Fri, 19 Jun 2015 14:02:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B2=8C=E4=BC=BC=E5=88=A0=E9=99=A4=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=B8=8D=E4=BC=9A=E6=9B=B4=E6=96=B0=E7=BC=93=E5=AD=98?= =?UTF-8?q?=20=E8=BF=98=E6=98=AF=E5=85=88=E4=B8=8D=E7=94=A8=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 524bde9d7..210ac8f3d 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -695,12 +695,13 @@ class CoursesController < ApplicationController # 显示老师和助教的活动 # @authors = searchTeacherAndAssistant(@course) @authors = course_all_member(@course) - Dir.glob("#{Rails.root}/app/models/*.rb").sort.each { |file| require file } + #TODO 貌似删除操作不会更新缓存 还是先不用缓存吧 + # Dir.glob("#{Rails.root}/app/models/*.rb").sort.each { |file| require file } events = [] - key = "course_events_#{@course.id}".to_sym - if Rails.env.production? && Setting.course_cahce_enabled? - events = Rails.cache.read(key) || [] - end + # key = "course_events_#{@course.id}".to_sym + # if Rails.env.production? && Setting.course_cahce_enabled? + # events = Rails.cache.read(key) || [] + # end if events.empty? @authors.each do |author| @activity = Redmine::Activity::Fetcher.new(User.current, :course => @course, @@ -716,7 +717,7 @@ class CoursesController < ApplicationController events += @activity.events(@days, @course.created_at, :is_public => 1) end end - Rails.cache.write(key, events) if Rails.env.production? && Setting.course_cahce_enabled? + # Rails.cache.write(key, events) if Rails.env.production? && Setting.course_cahce_enabled? end else # @author = @course.teacher