Move anti-caching parameter to load function

For less repetition and shorter paths in the higher level functions.
Active by default, but can be disabled.
This commit is contained in:
Dominik Reh
2023-02-10 11:59:06 +01:00
parent cbeced9121
commit d29298e0cc
7 changed files with 16 additions and 13 deletions

View File

@@ -35,7 +35,7 @@ class EmbeddingParser extends BaseTagParser {
async function load() {
if (embeddings.length === 0) {
try {
embeddings = (await readFile(`${tagBasePath}/temp/emb.txt?${new Date().getTime()}`)).split("\n")
embeddings = (await readFile(`${tagBasePath}/temp/emb.txt`)).split("\n")
.filter(x => x.trim().length > 0) // Remove empty lines
.map(x => x.trim().split(",")); // Split into name, version type pairs
} catch (e) {