Оптимизация

This commit is contained in:
Book Pauk
2022-10-31 01:16:23 +07:00
parent 55e05d3469
commit f2f22c362d
2 changed files with 50 additions and 22 deletions

View File

@@ -188,10 +188,18 @@ class WebWorker {
});
//открываем таблицы
await db.openAll({exclude: ['author_id', 'series_id', 'title_id']});
await db.openAll({exclude: ['author_id', 'series_id', 'title_id', 'book']});
const bookCacheSize = 500;
await db.open({
table: 'book',
cacheSize: (config.lowMemoryMode || config.dbCacheSize > bookCacheSize ? config.dbCacheSize : bookCacheSize)
});
//поисковый движок
this.dbSearcher = new DbSearcher(config, db);
//stuff
db.wwCache = {};
this.db = db;