Skip to content

Commit

Permalink
fix(runner): bring concurrency back
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 26, 2024
1 parent 206d208 commit 56075b5
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions lua/lazy/manage/runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,21 @@ function Runner:_start()
waiting = waiting + 1
wait_step = s.step
elseif not running then
local plugin = self:plugin(name)
if s.step == #self._pipeline then
s.task = nil
plugin._.working = false
elseif s.step < #self._pipeline then
active = active + 1
s.step = s.step + 1
step = self._pipeline[s.step]
if step.task == "wait" then
if not self._opts.concurrency or active < self._opts.concurrency then
local plugin = self:plugin(name)
if s.step == #self._pipeline then
s.task = nil
plugin._.working = false
else
s.task = self:queue(plugin, step)
plugin._.working = not not s.task
elseif s.step < #self._pipeline then
active = active + 1
s.step = s.step + 1
step = self._pipeline[s.step]
if step.task == "wait" then
plugin._.working = false
else
s.task = self:queue(plugin, step)
plugin._.working = not not s.task
end
end
end
else
Expand Down

0 comments on commit 56075b5

Please sign in to comment.