|
@@ -344,7 +344,7 @@ class ElasticsearchDelegator {
|
|
|
|
|
|
|
|
addAllPages() {
|
|
addAllPages() {
|
|
|
const Page = mongoose.model('Page');
|
|
const Page = mongoose.model('Page');
|
|
|
- return this.updateOrInsertPages(() => Page.find(), { isEmittingProgressEvent: true, fireGarbageCollection: true });
|
|
|
|
|
|
|
+ return this.updateOrInsertPages(() => Page.find(), { isEmittingProgressEvent: true, invokeGarbageCollection: true });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
updateOrInsertPageById(pageId) {
|
|
updateOrInsertPageById(pageId) {
|
|
@@ -356,7 +356,7 @@ class ElasticsearchDelegator {
|
|
|
* @param {function} queryFactory factory method to generate a Mongoose Query instance
|
|
* @param {function} queryFactory factory method to generate a Mongoose Query instance
|
|
|
*/
|
|
*/
|
|
|
async updateOrInsertPages(queryFactory, option = {}) {
|
|
async updateOrInsertPages(queryFactory, option = {}) {
|
|
|
- const { isEmittingProgressEvent = false, fireGarbageCollection = false } = option;
|
|
|
|
|
|
|
+ const { isEmittingProgressEvent = false, invokeGarbageCollection = false } = option;
|
|
|
|
|
|
|
|
const Page = mongoose.model('Page');
|
|
const Page = mongoose.model('Page');
|
|
|
const { PageQueryBuilder } = Page;
|
|
const { PageQueryBuilder } = Page;
|
|
@@ -467,7 +467,7 @@ class ElasticsearchDelegator {
|
|
|
logger.error('addAllPages error on add anyway: ', err);
|
|
logger.error('addAllPages error on add anyway: ', err);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (fireGarbageCollection) {
|
|
|
|
|
|
|
+ if (invokeGarbageCollection) {
|
|
|
try {
|
|
try {
|
|
|
// First aid to prevent unexplained memory leaks
|
|
// First aid to prevent unexplained memory leaks
|
|
|
global.gc();
|
|
global.gc();
|