fix error
This commit is contained in:
parent
619ce80267
commit
a73850d85d
|
@ -36,14 +36,13 @@ class BulletinFeed
|
||||||
else
|
else
|
||||||
Timeout::timeout(timeout) do
|
Timeout::timeout(timeout) do
|
||||||
feed_cache = nil
|
feed_cache = nil
|
||||||
Thread.new do
|
thread = Thread.new do
|
||||||
feed_cache = self.generate_one_cache(startdt: startdt,enddt: enddt,dt: dt,base_url: base_url)
|
feed_cache = self.generate_one_cache(startdt: startdt,enddt: enddt,dt: dt,base_url: base_url)
|
||||||
end
|
end
|
||||||
(1..(timeout.to_i+1)).each do
|
(1..(timeout.to_i+1)).each do
|
||||||
sleep(1)
|
sleep(1)
|
||||||
break if !feed_cache.nil?
|
break if !feed_cache.nil? && !thread.alive?
|
||||||
end
|
end
|
||||||
sleep(0.5)
|
|
||||||
feed_cache.content
|
feed_cache.content
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue