Skip to content

Commit 191e64c

Browse files
committed
chore(server_job): remove unused code
1 parent 7ca8000 commit 191e64c

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

lua/opencode/server_job.lua

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@ local function handle_api_response(response, cb)
1818
end
1919
end
2020

21-
function M.get_unresolved_requests()
22-
local unresolved = {}
23-
24-
for _, data in ipairs(M.requests) do
25-
if data[2]._resolved ~= true then
26-
table.insert(unresolved, data)
27-
end
28-
end
29-
30-
return unresolved
31-
end
32-
3321
--- Make an HTTP API call to the opencode server.
3422
--- @generic T
3523
--- @param url string The API endpoint URL
@@ -75,6 +63,8 @@ function M.call_api(url, method, body)
7563
end
7664

7765
-- For promise tracking, remove promises that complete from requests
66+
-- NOTE: can remove the request tracking code when we're happy with
67+
-- request reliability
7868
local request_entry = { opts, call_promise }
7969
table.insert(M.requests, request_entry)
8070

@@ -136,17 +126,6 @@ function M.stream_api(url, method, body, on_chunk)
136126
return curl.request(opts)
137127
end
138128

139-
---Forcibly reject any pending requests (they sometimes get stuck
140-
---after an api abort)
141-
function M.cancel_all_requests()
142-
for _, entry in ipairs(M.requests) do
143-
local promise = entry[2]
144-
if not promise:is_resolved() then
145-
pcall(promise.reject, promise, 'Request cancelled')
146-
end
147-
end
148-
end
149-
150129
function M.ensure_server()
151130
if state.opencode_server and state.opencode_server:is_running() then
152131
return state.opencode_server

0 commit comments

Comments
 (0)