We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0276793 commit f503346Copy full SHA for f503346
lua/mason-core/async/init.lua
@@ -176,13 +176,14 @@ local function wait(suspend_fns, mode)
176
for i, suspend_fn in ipairs(suspend_fns) do
177
thread_cancellations[i] = exports.run(suspend_fn, function(success, result)
178
completed = completed + 1
179
+ if channel:is_closed() then
180
+ return
181
+ end
182
if not success then
- if not channel:is_closed() then
- cancel()
- channel:send(false, result)
183
- results = nil
184
- thread_cancellations = {}
185
- end
+ cancel()
+ channel:send(false, result)
+ results = nil
186
+ thread_cancellations = {}
187
else
188
results[i] = result
189
if mode == "first" or completed >= count then
0 commit comments