Fix the build on travis.

This commit is contained in:
Guo Xiang Tan 2017-05-15 19:47:40 +08:00
parent afbefd1e02
commit 0306863d71
2 changed files with 11 additions and 5 deletions

View File

@ -80,7 +80,7 @@ GEM
diff-lcs (1.3)
discourse-qunit-rails (0.0.9)
railties
discourse_image_optim (0.24.4)
discourse_image_optim (0.24.5)
exifr (~> 1.2, >= 1.2.2)
fspath (~> 3.0)
image_size (~> 1.5)

View File

@ -16,7 +16,8 @@ class SocketServer
end
def stop
@server.close if @server
@server&.close rescue nil
FileUtils.rm_f(@socket_path)
@server = nil
@blk = nil
end
@ -26,9 +27,14 @@ class SocketServer
def new_accept_thread
server = @server
Thread.new do
done = false
while !done
done = !accept_connection(server)
begin
done = false
while !done
done = !accept_connection(server)
end
ensure
self.stop
Rails.logger.info("Cleaned up socket server at #{@socket_path}")
end
end
end