From 2067444a7ec7217afa66f175a6016bc9c01de64f Mon Sep 17 00:00:00 2001 From: Bohung Date: Mon, 13 Jun 2022 16:19:51 +0800 Subject: [PATCH] Fix rake bug. --- lib/announcement/engine.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/announcement/engine.rb b/lib/announcement/engine.rb index 65c574d..71d0c0b 100644 --- a/lib/announcement/engine.rb +++ b/lib/announcement/engine.rb @@ -98,12 +98,14 @@ module Announcement rescue => e puts ['there_was_no_show_option_method',e] end - begin - avoid_page_cache AnnsCache - avoid_page_cache BulletinFeedCache - avoid_page_cache BulletinFeed - rescue => e - puts ["avoid_page_cache", e.to_s] + if File.basename($0) != 'rake' + begin + avoid_page_cache AnnsCache + avoid_page_cache BulletinFeedCache + avoid_page_cache BulletinFeed + rescue => e + puts ["avoid_page_cache", e.to_s] + end end side_bar do head_label_i18n 'announcement.announcement', icon_class: "icons-megaphone"