mirror of https://github.com/folke/lazy.nvim.git
fix(cache): dont keep invalid entries in the cache (cleanup)
This commit is contained in:
parent
d3a963d51c
commit
9fa62ea8ea
|
@ -144,9 +144,14 @@ function M.loader(modname)
|
||||||
local entry = M.cache[modname]
|
local entry = M.cache[modname]
|
||||||
|
|
||||||
local chunk, err
|
local chunk, err
|
||||||
if entry and M.check_path(modname, entry.modpath) then
|
if entry then
|
||||||
M.stats.find.total = M.stats.find.total + 1
|
if M.check_path(modname, entry.modpath) then
|
||||||
chunk, err = M.load(modname, entry.modpath)
|
M.stats.find.total = M.stats.find.total + 1
|
||||||
|
chunk, err = M.load(modname, entry.modpath)
|
||||||
|
else
|
||||||
|
M.cache[modname] = nil
|
||||||
|
M.dirty = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if not chunk then
|
if not chunk then
|
||||||
-- find the modpath and load the module
|
-- find the modpath and load the module
|
||||||
|
|
Loading…
Reference in New Issue