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) 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)

View File

@ -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