Skip to content

Commit

Permalink
fix(cache): dont keep invalid entries in the cache (cleanup)
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 10, 2023
1 parent d3a963d commit 9fa62ea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lua/lazy/core/cache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,14 @@ function M.loader(modname)
local entry = M.cache[modname]

local chunk, err
if entry and M.check_path(modname, entry.modpath) then
M.stats.find.total = M.stats.find.total + 1
chunk, err = M.load(modname, entry.modpath)
if entry then
if M.check_path(modname, entry.modpath) then
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
if not chunk then
-- find the modpath and load the module
Expand Down

0 comments on commit 9fa62ea

Please sign in to comment.