From def5cc58166e914bce0a20ed60e0c8be99e76eb4 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 30 Dec 2022 11:35:09 +0100 Subject: [PATCH] fix(cache): clear cached entry on errors --- lua/lazy/core/cache.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazy/core/cache.lua b/lua/lazy/core/cache.lua index b2c7c8e..0589454 100644 --- a/lua/lazy/core/cache.lua +++ b/lua/lazy/core/cache.lua @@ -189,9 +189,11 @@ function M.load(modkey, modpath) end chunk, err = M._loadfile(entry.modpath) + M.dirty = true if chunk then - M.dirty = true entry.chunk = string.dump(chunk) + else + M.cache[modkey] = nil end return chunk, err end