mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 02:22:46 +08:00
DEV: Fix randomly failing test.
Even if a thread is alive in the loop check, it may be dead by the time `Thread#wakeup` is called on it.
This commit is contained in:
parent
83f13ecf82
commit
adbc87857e
|
@ -61,7 +61,14 @@ class SidekiqPauser
|
|||
if t = @extend_lease_thread
|
||||
@extend_lease_thread = nil
|
||||
while t.alive?
|
||||
t.wakeup
|
||||
begin
|
||||
t.wakeup
|
||||
rescue ThreadError => e
|
||||
unless e.message =~ /killed thread/
|
||||
raise e
|
||||
end
|
||||
end
|
||||
|
||||
sleep 0
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user