vecfinder

Document searching tool based on embedding vectors
git clone git://git.finwo.net/app/vecfinder
Log | Files | Refs

commit 51a3a4e79df76a4b29ad09056e22c67a754ce498
parent 5d1bf412d6266ccb37a618e30b7f3a0f7cc3bfa5
Author: finwo <finwo@pm.me>
Date:   Sun, 22 Mar 2026 16:57:55 +0100

Only discard cache if file newer than cache

Diffstat:
Mvecfinder.js | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vecfinder.js b/vecfinder.js @@ -63,7 +63,7 @@ async function getCachedVector(filePath) { try { const cp = cachePath(filePath); const [cacheStat, fileStat] = await Promise.all([fs.stat(cp), fs.stat(filePath)]); - if (fileStat.mtimeMs >= cacheStat.mtimeMs) return null; + if (fileStat.mtimeMs > cacheStat.mtimeMs) return null; const buf = await fs.readFile(cp); return Array.from(new Float64Array(buf.buffer, buf.byteOffset, buf.byteLength / 8)); } catch {