From b5fbe80a7c34bb6224c643b7117d6a388ef69251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Tue, 9 Nov 2021 18:23:19 +0800 Subject: [PATCH] fix error --- lib/feeds/engine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/feeds/engine.rb b/lib/feeds/engine.rb index 55c9053..87bc8c5 100644 --- a/lib/feeds/engine.rb +++ b/lib/feeds/engine.rb @@ -5,7 +5,7 @@ module Feeds begin require File.expand_path('../../../app/models/site_feed', __FILE__) require File.expand_path('../../../app/models/site_feed_annc', __FILE__) - if defined?(SiteFeed) && defined?(SiteFeedAnnc) + if ENV['worker_num']=='0' && File.basename($0) != 'rake' && !Rails.const_defined?('Console') && defined?(SiteFeed) && defined?(SiteFeedAnnc) SiteFeed.each do |site_feed| tmp = SiteFeedAnnc.where(feed_id: site_feed.id).first if site_feed.disabled != true