From 36a26580df1ccb9831dc8bbd288c21bdd3810731 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Sun, 5 Jan 2025 16:21:00 +0300 Subject: [PATCH] [log] Turn off error log message in addRandomKeyTask(downloadAs) --- DocService/sources/taskresult.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DocService/sources/taskresult.js b/DocService/sources/taskresult.js index 62a41133..4a5fd6be 100644 --- a/DocService/sources/taskresult.js +++ b/DocService/sources/taskresult.js @@ -224,13 +224,13 @@ function restoreInitialPassword(ctx, docId) { }); } -function addRandomKey(ctx, task, opt_prefix, opt_size) { +function addRandomKey(ctx, task, key, opt_prefix, opt_size) { return new Promise(function(resolve, reject) { task.tenant = ctx.tenant; if (undefined !== opt_prefix && undefined !== opt_size) { task.key = opt_prefix + crypto.randomBytes(opt_size).toString("hex"); } else { - task.key = task.key + '_' + Math.round(Math.random() * RANDOM_KEY_MAX); + task.key = key + '_' + Math.round(Math.random() * RANDOM_KEY_MAX); } task.completeDefaults(); let values = []; @@ -251,7 +251,7 @@ function addRandomKey(ctx, task, opt_prefix, opt_size) { } else { resolve(result); } - }, undefined, undefined, values); + }, undefined, true, values); }); } function* addRandomKeyTask(ctx, key, opt_prefix, opt_size) { @@ -264,10 +264,10 @@ function* addRandomKeyTask(ctx, key, opt_prefix, opt_size) { var addRes = null; while (nTryCount-- > 0) { try { - addRes = yield addRandomKey(ctx, task, opt_prefix, opt_size); + addRes = yield addRandomKey(ctx, task, key, opt_prefix, opt_size); } catch (e) { addRes = null; - //key exist, try again + ctx.logger.debug("addRandomKeyTask %s exists, try again", task.key); } if (addRes && addRes.affectedRows > 0) { break;