MCPcopy
hub / github.com/scality/cloudserver / deleteMDandData

Function deleteMDandData

lib/services.js:355–383  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

353 assert.strictEqual(typeof objectMD, 'object');
354
355 function deleteMDandData() {
356 return metadata.deleteObjectMD(bucketName, objectKey, options, log,
357 (err, res) => {
358 if (err) {
359 return cb(err, res);
360 }
361 log.trace('deleteObject: metadata delete OK');
362 if (objectMD.location === null) {
363 return cb(null, res);
364 }
365
366 if (deferLocationDeletion) {
367 return cb(null, Array.isArray(objectMD.location)
368 ? objectMD.location : [objectMD.location]);
369 }
370
371 if (!Array.isArray(objectMD.location)) {
372 data.delete(objectMD.location, log);
373 return cb(null, res);
374 }
375
376 return data.batchDelete(objectMD.location, null, null, log, err => {
377 if (err) {
378 return cb(err);
379 }
380 return cb(null, res);
381 });
382 }, originOp);
383 }
384
385 const objGetInfo = objectMD.location;
386 // special case that prevents azure blocks from unecessary deletion

Callers 1

deleteObjectFunction · 0.85

Calls 1

traceMethod · 0.80

Tested by

no test coverage detected