avoid timeout
This commit is contained in:
parent
2c16e3458f
commit
35153a0020
|
@ -21,12 +21,16 @@ module FeedModel
|
||||||
end
|
end
|
||||||
def do_before_save
|
def do_before_save
|
||||||
if self.class == Category
|
if self.class == Category
|
||||||
|
Thread.new do
|
||||||
SiteFeedAnnc.where(merge_with_category: self.id.to_s).each do |site_feed_annc|
|
SiteFeedAnnc.where(merge_with_category: self.id.to_s).each do |site_feed_annc|
|
||||||
recreate_annc_cache(site_feed_annc)
|
recreate_annc_cache(site_feed_annc)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
elsif self.class == SiteFeed
|
elsif self.class == SiteFeed
|
||||||
if self.disabled != true
|
if self.disabled != true
|
||||||
|
Thread.new do
|
||||||
recreate_annc_cache(self)
|
recreate_annc_cache(self)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
tmp = SiteFeedAnnc.where(feed_id: self.id).first
|
tmp = SiteFeedAnnc.where(feed_id: self.id).first
|
||||||
if !tmp.nil?
|
if !tmp.nil?
|
||||||
|
|
Loading…
Reference in New Issue