Skip to content

Commit 56075b5

Browse files
committed
fix(runner): bring concurrency back
1 parent 206d208 commit 56075b5

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

lua/lazy/manage/runner.lua

+14-12
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,21 @@ function Runner:_start()
9696
waiting = waiting + 1
9797
wait_step = s.step
9898
elseif not running then
99-
local plugin = self:plugin(name)
100-
if s.step == #self._pipeline then
101-
s.task = nil
102-
plugin._.working = false
103-
elseif s.step < #self._pipeline then
104-
active = active + 1
105-
s.step = s.step + 1
106-
step = self._pipeline[s.step]
107-
if step.task == "wait" then
99+
if not self._opts.concurrency or active < self._opts.concurrency then
100+
local plugin = self:plugin(name)
101+
if s.step == #self._pipeline then
102+
s.task = nil
108103
plugin._.working = false
109-
else
110-
s.task = self:queue(plugin, step)
111-
plugin._.working = not not s.task
104+
elseif s.step < #self._pipeline then
105+
active = active + 1
106+
s.step = s.step + 1
107+
step = self._pipeline[s.step]
108+
if step.task == "wait" then
109+
plugin._.working = false
110+
else
111+
s.task = self:queue(plugin, step)
112+
plugin._.working = not not s.task
113+
end
112114
end
113115
end
114116
else

0 commit comments

Comments
 (0)