Skip to content

Commit

Permalink
fix(checker): make sure we show logs when only doing a fast check
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 22, 2023
1 parent 96d759d commit 4008b57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion lua/lazy/manage/checker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@ M.reported = {}

function M.start()
M.fast_check()
M.schedule()
if M.schedule() > 0 then
Manage.log({
show = false,
check = true,
concurrency = Config.options.checker.concurrency,
})
end
end

function M.schedule()
State.read() -- update state
local next_check = State.checker.last_check + Config.options.checker.frequency - os.time()
next_check = math.max(next_check, 0)
vim.defer_fn(M.check, next_check * 1000)
return next_check
end

---@param opts? {report:boolean} report defaults to true
Expand Down
4 changes: 2 additions & 2 deletions lua/lazy/manage/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ function M.check(opts)
}, opts)
end

---@param opts? ManagerOpts
---@param opts? ManagerOpts | {check?:boolean}
function M.log(opts)
opts = M.opts(opts, { mode = "log" })
return M.run({
pipeline = {
{ "git.origin", check = true },
"git.log",
{ "git.log", check = opts.check },
},
plugins = function(plugin)
return plugin.url and plugin._.installed
Expand Down

0 comments on commit 4008b57

Please sign in to comment.