Fix the build on travis.
This commit is contained in:
parent
afbefd1e02
commit
0306863d71
|
@ -80,7 +80,7 @@ GEM
|
||||||
diff-lcs (1.3)
|
diff-lcs (1.3)
|
||||||
discourse-qunit-rails (0.0.9)
|
discourse-qunit-rails (0.0.9)
|
||||||
railties
|
railties
|
||||||
discourse_image_optim (0.24.4)
|
discourse_image_optim (0.24.5)
|
||||||
exifr (~> 1.2, >= 1.2.2)
|
exifr (~> 1.2, >= 1.2.2)
|
||||||
fspath (~> 3.0)
|
fspath (~> 3.0)
|
||||||
image_size (~> 1.5)
|
image_size (~> 1.5)
|
||||||
|
|
|
@ -16,7 +16,8 @@ class SocketServer
|
||||||
end
|
end
|
||||||
|
|
||||||
def stop
|
def stop
|
||||||
@server.close if @server
|
@server&.close rescue nil
|
||||||
|
FileUtils.rm_f(@socket_path)
|
||||||
@server = nil
|
@server = nil
|
||||||
@blk = nil
|
@blk = nil
|
||||||
end
|
end
|
||||||
|
@ -26,9 +27,14 @@ class SocketServer
|
||||||
def new_accept_thread
|
def new_accept_thread
|
||||||
server = @server
|
server = @server
|
||||||
Thread.new do
|
Thread.new do
|
||||||
done = false
|
begin
|
||||||
while !done
|
done = false
|
||||||
done = !accept_connection(server)
|
while !done
|
||||||
|
done = !accept_connection(server)
|
||||||
|
end
|
||||||
|
ensure
|
||||||
|
self.stop
|
||||||
|
Rails.logger.info("Cleaned up socket server at #{@socket_path}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue