From 831a9be4467092111b6b830eeddcae8fe84dbbec Mon Sep 17 00:00:00 2001 From: Keerthi Niranjan Date: Tue, 12 Dec 2017 11:02:05 +0530 Subject: [PATCH] SEARCH-535 - Renamed deleteFolderRecursive to deleteIndexFolders --- js/search/search.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/search/search.js b/js/search/search.js index a443f666..b850c6ca 100644 --- a/js/search/search.js +++ b/js/search/search.js @@ -71,8 +71,8 @@ class Search { init() { libSymphonySearch.symSEInit(); libSymphonySearch.symSEEnsureFolderExists(this.dataFolder); - Search.deleteFolderRecursive(this.realTimeIndex); - Search.deleteFolderRecursive(this.batchIndex); + Search.deleteIndexFolders(this.realTimeIndex); + Search.deleteIndexFolders(this.batchIndex); Search.indexValidator(this.indexFolderName); Search.indexValidator(this.realTimeIndex); let indexDateStartFrom = new Date().getTime() - searchConfig.SEARCH_PERIOD_SUBTRACTOR; @@ -139,7 +139,7 @@ class Search { reject(new Error(err)); return; } - Search.deleteFolderRecursive(this.batchIndex); + Search.deleteIndexFolders(this.batchIndex); resolve(res); }); }); @@ -549,12 +549,12 @@ class Search { * Removing all the folders and files inside the data folder * @param location */ - static deleteFolderRecursive(location) { + static deleteIndexFolders(location) { if (fs.existsSync(location)) { fs.readdirSync(location).forEach((file) => { let curPath = location + "/" + file; if (fs.lstatSync(curPath).isDirectory()) { - Search.deleteFolderRecursive(curPath); + Search.deleteIndexFolders(curPath); } else { fs.unlinkSync(curPath); } @@ -570,7 +570,7 @@ class Search { * when the app is closed/signed-out/navigates */ function deleteIndexFolder() { - Search.deleteFolderRecursive(searchConfig.FOLDERS_CONSTANTS.INDEX_PATH); + Search.deleteIndexFolders(searchConfig.FOLDERS_CONSTANTS.INDEX_PATH); } /**