rename fileRemover to file trasher

This commit is contained in:
Abhinav 2023-04-28 13:29:56 +05:30
parent 218a27bbae
commit 3a9856dfce

View file

@ -355,8 +355,8 @@ class ExportService {
} }
if (removedFileUIDs?.length > 0) { if (removedFileUIDs?.length > 0) {
addLogLine(`removing ${removedFileUIDs.length} files`); addLogLine(`trashing ${removedFileUIDs.length} files`);
await this.fileRemover( await this.fileTrasher(
exportDir, exportDir,
collectionIDExportNameMap, collectionIDExportNameMap,
removedFileUIDs, removedFileUIDs,
@ -595,7 +595,7 @@ class ExportService {
} }
} }
async fileRemover( async fileTrasher(
exportDir: string, exportDir: string,
collectionIDExportNameMap: Map<number, string>, collectionIDExportNameMap: Map<number, string>,
removedFileUIDs: string[], removedFileUIDs: string[],
@ -608,7 +608,7 @@ class ExportService {
exportRecord.fileExportNames exportRecord.fileExportNames
); );
for (const fileUID of removedFileUIDs) { for (const fileUID of removedFileUIDs) {
addLocalLog(() => `removing file with id ${fileUID}`); addLocalLog(() => `trashing file with id ${fileUID}`);
if (this.stopExport) { if (this.stopExport) {
break; break;
} }
@ -698,7 +698,7 @@ class ExportService {
incrementSuccess(); incrementSuccess();
} catch (e) { } catch (e) {
incrementFailed(); incrementFailed();
logError(e, 'remove failed for a file'); logError(e, 'trashing failed for a file');
if ( if (
e.message === e.message ===
CustomError.ADD_FILE_EXPORTED_RECORD_FAILED CustomError.ADD_FILE_EXPORTED_RECORD_FAILED
@ -708,7 +708,7 @@ class ExportService {
} }
} }
} catch (e) { } catch (e) {
logError(e, 'fileRemover failed'); logError(e, 'fileTrasher failed');
throw e; throw e;
} }
} }