mirror of
https://github.com/alexankitty/Myrient-Search-Engine.git
synced 2026-01-15 16:33:15 -03:00
add db kw optimizer env and disable by default until I get off my ass and actually fix the memory usage problems and postgres pagination issues, hey wait shouldn't this be in an issue and not a commit? Oh well
This commit is contained in:
@@ -101,7 +101,9 @@ async function getFilesJob() {
|
||||
metadataMatchCount = await File.count({
|
||||
where: { detailsId: { [Op.ne]: null } },
|
||||
});
|
||||
await optimizeDatabaseKws();
|
||||
if(process.env.DB_KEYWORD_OPTIMIZER === "1"){
|
||||
await optimizeDatabaseKws();
|
||||
}
|
||||
}
|
||||
//this is less important and needs to run last.
|
||||
if (fileCount > oldFileCount && (await Metadata.count())) {
|
||||
@@ -132,6 +134,7 @@ async function updateMetadata() {
|
||||
|
||||
async function updateKws() {
|
||||
if (updatingFiles) return;
|
||||
if (process.env.DB_KEYWORD_OPTIMIZER !== "1") return;
|
||||
if (!(await File.count({ where: { filenamekws: { [Op.ne]: null } } })) || process.env.FORCE_DB_OPTIMIZE == "1") {
|
||||
await optimizeDatabaseKws();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user