mirror of https://github.com/folke/lazy.nvim.git
fix(cache): reload file if compiled code is incompatible. Fixes #225
This commit is contained in:
parent
4e3a973f85
commit
b8c5ab5dae
|
@ -158,7 +158,10 @@ function M.load(modkey, modpath)
|
||||||
entry.used = os.time()
|
entry.used = os.time()
|
||||||
if M.eq(entry.hash, hash) then
|
if M.eq(entry.hash, hash) then
|
||||||
-- found in cache and up to date
|
-- found in cache and up to date
|
||||||
return loadstring(entry.chunk --[[@as string]], "@" .. entry.modpath)
|
local chunk, err = loadstring(entry.chunk --[[@as string]], "@" .. entry.modpath)
|
||||||
|
if not (err and err:find("cannot load incompatible bytecode", 1, true)) then
|
||||||
|
return chunk, err
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
entry = { hash = hash, modpath = modpath, used = os.time() }
|
entry = { hash = hash, modpath = modpath, used = os.time() }
|
||||||
|
|
Loading…
Reference in New Issue