fix feed error
This commit is contained in:
1 parent
c5f95c9968
commit
234ed6cfea
10 files changed
+232
-172
No files matched your search
@@ -71,9 +71,11 @@ module Announcement
|
||||
data[key4] = key4_attr
|
||||
data_item[key_item1] = [value_item1,value_item2,value_item3]
|
||||
data_item[key_item2] = [value2_item1,value2_item2]
|
||||
require File.expand_path('../../../app/models/anns_cache', __FILE__)
|
||||
if defined? AnnsCache
|
||||
AnnsCache.destroy_all
|
||||
if ENV['worker_num']=='0' && File.basename($0) != 'rake' && !Rails.const_defined?('Console')
|
||||
require File.expand_path('../../../app/models/anns_cache', __FILE__)
|
||||
if defined?(AnnsCache)
|
||||
AnnsCache.destroy_all
|
||||
end
|
||||
end
|
||||
rescue => e
|
||||
puts ['error in announcement',e]
|
||||
|
||||
@@ -11,7 +11,11 @@ module BulletinModel
|
||||
elsif self.class == Bulletin || (self.class == Page && self.module == "announcement")
|
||||
if self.class == Bulletin
|
||||
tmp_tag_ids = (Array(self.tag_ids) + Array(self.org_tag_ids)).uniq
|
||||
BulletinFeedCache.where(:uid.in => BulletinFeed.where(:tag_ids.in => tmp_tag_ids.collect{|v| v.to_s}).pluck(:uid)).destroy
|
||||
Thread.new do
|
||||
BulletinFeedCache.where(:uid.in => BulletinFeed.where(:tag_ids.in => tmp_tag_ids.collect{|v| v.to_s}).pluck(:uid)).each do |cache|
|
||||
cache.regenerate
|
||||
end
|
||||
end
|
||||
end
|
||||
AnnsCache.all.destroy
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user