rename function

This commit is contained in:
Girish Ramakrishnan
2025-02-13 17:07:34 +01:00
parent b94ce542c3
commit c7572f0624

View File

@@ -77,7 +77,7 @@ async function addFile(sourceFile, encryption, uploader, progressCallback) {
await uploader.finish();
}
async function processChange(change, backupConfig, remotePath, dataLayout, progressCallback) {
async function processSyncerChange(change, backupConfig, remotePath, dataLayout, progressCallback) {
debug('sync: processing task: %j', change);
// the empty task.path is special to signify the directory
const destPath = change.path && backupConfig.encryptedFilenames ? hush.encryptFilePath(change.path, backupConfig.encryption) : change.path;
@@ -112,10 +112,10 @@ async function sync(backupConfig, remotePath, dataLayout, progressCallback) {
const changes = await syncer.sync(dataLayout);
debug(`sync: processing ${changes.delQueue.length} deletes and ${changes.addQueue.length} additions`);
const [delError] = await safe(async.eachLimit(changes.delQueue, concurrency, async (task) => await processChange(task, backupConfig, remotePath, dataLayout, progressCallback)));
const [delError] = await safe(async.eachLimit(changes.delQueue, concurrency, async (change) => await processSyncerChange(change, backupConfig, remotePath, dataLayout, progressCallback)));
debug('sync: done processing deletes. error: %o', delError);
const [addError] = await safe(async.eachLimit(changes.addQueue, concurrency, async (task) => await processChange(task, backupConfig, remotePath, dataLayout, progressCallback)));
const [addError] = await safe(async.eachLimit(changes.addQueue, concurrency, async (change) => await processSyncerChange(change, backupConfig, remotePath, dataLayout, progressCallback)));
debug('sync: done processing adds. error: %o', addError);
if (addError) throw addError;