fix error

This commit is contained in:
邱博亞 2021-11-18 10:30:25 +08:00
parent 6807b93489
commit 4da5940753
1 changed files with 15 additions and 11 deletions

View File

@ -29,8 +29,11 @@ class BulletinFeed
end end
end end
def generate_one_cache_timeout(startdt: nil,enddt: nil,dt: nil, base_url: nil, timeout: nil) def generate_one_cache_timeout(startdt: nil,enddt: nil,dt: nil, base_url: nil, timeout: nil)
timeout = 100000 if timeout.nil?
begin begin
if timeout.nil?
feed_cache = self.generate_one_cache(startdt: startdt,enddt: enddt,dt: dt,base_url: base_url)
feed_cache.content
else
Timeout::timeout(timeout) { Timeout::timeout(timeout) {
feed_cache = nil feed_cache = nil
Thread.new do Thread.new do
@ -42,6 +45,7 @@ class BulletinFeed
end end
feed_cache.content feed_cache.content
} }
end
rescue=> e rescue=> e
puts [e,e.backtrace] puts [e,e.backtrace]
"" ""