fix error
This commit is contained in:
parent
6807b93489
commit
4da5940753
|
@ -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]
|
||||||
""
|
""
|
||||||
|
|
Loading…
Reference in New Issue