Skip to content

Commit

Permalink
CLDSRV-402: allow to disable optimizations with config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
williamlardier committed Jun 22, 2023
1 parent 21d22ad commit db892df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,11 @@ class Config extends EventEmitter {
this.multiObjectDeleteConcurrency = extractedNumber;
}
}

this.multiObjectDeleteEnableOptimizations = true;
if (config.multiObjectDeleteEnableOptimizations === false) {
this.multiObjectDeleteEnableOptimizations = false;
}
}

_configureBackends() {
Expand Down
5 changes: 4 additions & 1 deletion lib/api/multiObjectDelete.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ function decodeObjectVersion(entry) {
* @return {undefined}
*/
function initializeMultiObjectDeleteWithBatchingSupport(bucketName, inPlay, log, callback) {
if (config.multiObjectDeleteEnableOptimizations === false) {
return callback(null, {});
}
// If the backend supports batching, we want to optimize the API latency by
// first getting all the objects metadata, stored in memory, for later use
// in the API. This approach does not change the API architecture, but
Expand Down Expand Up @@ -340,7 +343,7 @@ function getObjMetadataAndDelete(authInfo, canonicalID, request,
options.replayId = objMD.uploadId;
}
return services.deleteObject(bucketName, objMD,
entry.key, options, true, log, (err, toDelete) => {
entry.key, options, config.multiObjectDeleteEnableOptimizations, log, (err, toDelete) => {
if (err) {
return callback(err);
}
Expand Down

0 comments on commit db892df

Please sign in to comment.