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
def generate_one_cache_timeout(startdt: nil,enddt: nil,dt: nil, base_url: nil, timeout: nil)
timeout = 100000 if timeout.nil?
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) {
feed_cache = nil
Thread.new do
@ -42,6 +45,7 @@ class BulletinFeed
end
feed_cache.content
}
end
rescue=> e
puts [e,e.backtrace]
""