Skip to content

Commit

Permalink
fix(checker): dont check for updates when there's tasks with errors
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 23, 2023
1 parent ed21070 commit c32a618
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lua/lazy/manage/checker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ M.reported = {}

function M.start()
M.fast_check()
if M.schedule() > 0 then
if M.schedule() > 0 and not M.has_errors() then
Manage.log({
clear = false,
show = false,
Expand Down Expand Up @@ -47,17 +47,19 @@ function M.fast_check(opts)
M.report(opts.report ~= false)
end

function M.check()
State.checker.last_check = os.time()
State.write() -- update state
local errors = false
function M.has_errors()
for _, plugin in pairs(Config.plugins) do
if Plugin.has_errors(plugin) then
errors = true
break
return true
end
end
if errors then
return false
end

function M.check()
State.checker.last_check = os.time()
State.write() -- update state
if M.has_errors() then
M.schedule()
else
Manage.check({
Expand Down

0 comments on commit c32a618

Please sign in to comment.