Skip to content

Commit bafa722

Browse files
committed
♻️ move to manual callbackify
Issue: CLDSRV-823
1 parent 717e694 commit bafa722

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

lib/api/bucketGet.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const { callbackify } = require('util');
21
const querystring = require('querystring');
32
const { errors, errorInstances, versioning, s3middleware } = require('arsenal');
43
const constants = require('../../constants');
@@ -390,6 +389,13 @@ async function bucketGet(authInfo, request, log) {
390389
module.exports = {
391390
processVersions,
392391
processMasterVersions,
393-
bucketGet: callbackify(bucketGet),
392+
bucketGet: (...args) => {
393+
const callback = args.at(-1);
394+
const argsWithoutCallback = args.slice(0, -1);
395+
396+
bucketGet(...argsWithoutCallback)
397+
.then(result => callback(null, ...result))
398+
.catch(err => callback(err));
399+
},
394400
};
395401

lib/api/objectGetLegalHold.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const { callbackify } = require('util');
21
const { errors, errorInstances, s3middleware } = require('arsenal');
32

43
const { decodeVersionId, getVersionIdResHeader }
@@ -104,4 +103,11 @@ async function objectGetLegalHold(authInfo, request, log) {
104103
}
105104
}
106105

107-
module.exports = callbackify(objectGetLegalHold);
106+
module.exports = (...args) => {
107+
const callback = args.at(-1);
108+
const argsWithoutCallback = args.slice(0, -1);
109+
110+
objectGetLegalHold(...argsWithoutCallback)
111+
.then(result => callback(null, ...result))
112+
.catch(err => callback(err));
113+
};

0 commit comments

Comments
 (0)