Compare commits

..

No commits in common. "6b5139ebaae770b7c212c796405c6bcfd0db3e37" and "f08d066d826f4f29705f944a6687b919a5a36e56" have entirely different histories.

1 changed files with 6 additions and 19 deletions

View File

@ -1045,13 +1045,9 @@ class MongoClientInterface {
const c = this.getCollection(bucketName); const c = this.getCollection(bucketName);
let vFormat = null; let vFormat = null;
// Function to process each document // Function to process each document
const processDoc = (doc, objName, params, key, cb) => { const processDoc = (doc, objName, params, cb) => {
if (!doc && params && params.versionId) { if (!doc && params && params.versionId) {
return cb(null, { return cb(errors.NoSuchKey);
doc: null,
versionId: params.versionId,
key,
});
} }
// If no master found then object is either non existent // If no master found then object is either non existent
// or last version is delete marker // or last version is delete marker
@ -1060,19 +1056,11 @@ class MongoClientInterface {
if (err && !err.is.NoSuchKey) { if (err && !err.is.NoSuchKey) {
return cb(err); return cb(err);
} }
return cb(null, { return cb(null, doc || null);
doc: doc || null,
versionId: params.versionId,
key,
});
}); });
} }
MongoUtils.unserialize(doc.value); MongoUtils.unserialize(doc.value);
return cb(null, { return cb(null, doc.value);
doc: doc.value,
versionId: params.versionId,
key,
});
}; };
this.getBucketVFormat(bucketName, log, (err, _vFormat) => { this.getBucketVFormat(bucketName, log, (err, _vFormat) => {
if (err) { if (err) {
@ -1100,7 +1088,7 @@ class MongoClientInterface {
// Process each document using associated context (objName, params) // Process each document using associated context (objName, params)
async.mapLimit(keysAndObjects, 5, ({ key, objName, params }, cb) => { async.mapLimit(keysAndObjects, 5, ({ key, objName, params }, cb) => {
const doc = docByKey.get(key); const doc = docByKey.get(key);
processDoc(doc, objName, params, key, cb); processDoc(doc, objName, params, cb);
}, callback); }, callback);
}).catch(err => { }).catch(err => {
callback(err); callback(err);
@ -1495,8 +1483,7 @@ class MongoClientInterface {
* @param {object} [params] request params * @param {object} [params] request params
* @return {undefined} * @return {undefined}
*/ */
internalDeleteObject(collection, bucketName, key, filter, log, cb, originOp = 's3:ObjectRemoved:Delete', internalDeleteObject(collection, bucketName, key, filter, log, cb, originOp = 's3:ObjectRemoved:Delete', params = null) {
params = null) {
// filter used when deleting object // filter used when deleting object
const deleteFilter = Object.assign({ const deleteFilter = Object.assign({
_id: key, _id: key,