fix(params_getter): try to bind even if socket exists
This commit is contained in:
@@ -37,15 +37,15 @@ local socket_start = nio.control.future()
|
||||
-- @return string: Concatenated response from server
|
||||
local function get_socket_path(cmd, messages, callback)
|
||||
-- 1. Run the command and capture its output (socket path)
|
||||
local stdout = assert(vim.uv.new_pipe())
|
||||
local stderr = assert(vim.uv.new_pipe())
|
||||
local stdin = assert(vim.uv.new_pipe())
|
||||
if socket_path == "" and not socket_start.is_set() then
|
||||
local stdout = assert(vim.uv.new_pipe(true))
|
||||
local stderr = assert(vim.uv.new_pipe(true))
|
||||
local stdin = assert(vim.uv.new_pipe(true))
|
||||
socket_start.set()
|
||||
local handle
|
||||
handle, _ = vim.uv.spawn(cmd[1], {
|
||||
stdio = { stdin, stdout, stderr },
|
||||
detached = false,
|
||||
detached = true,
|
||||
args = #cmd > 1 and vim.list_slice(cmd, 2, #cmd) or { cmd[1] },
|
||||
}, function(code, signal)
|
||||
vim.uv.close(stdout)
|
||||
|
@@ -136,7 +136,7 @@ async def serve_socket():
|
||||
|
||||
if python_socket_path.exists():
|
||||
print(python_socket_path)
|
||||
return
|
||||
|
||||
atexit.register(lambda: _close_socket(python_socket_path))
|
||||
|
||||
signal.signal(signal.SIGTERM, lambda x, _: _close_socket(python_socket_path))
|
||||
|
Reference in New Issue
Block a user