use callback in 'getLimit'
This commit is contained in:
parent
77efc2cee7
commit
fa4b17e2bc
6
rpc.js
6
rpc.js
@ -509,9 +509,12 @@ var updateLimits = function (config, publicKey, cb) {
|
|||||||
|
|
||||||
req.end(body);
|
req.end(body);
|
||||||
};
|
};
|
||||||
|
|
||||||
var getLimit = function (publicKey, cb) {
|
var getLimit = function (publicKey, cb) {
|
||||||
var limit = limits[publicKey];
|
var limit = limits[publicKey];
|
||||||
return limit && typeof limit.limit === "number" ? limit.limit : DEFAULT_LIMIT;
|
|
||||||
|
cb(void 0, limit && typeof(limit.limit) === "number"?
|
||||||
|
limit.limit : DEFAULT_LIMIT);
|
||||||
};
|
};
|
||||||
|
|
||||||
var safeMkdir = function (path, cb) {
|
var safeMkdir = function (path, cb) {
|
||||||
@ -787,7 +790,6 @@ RPC.create = function (config /*:typeof(ConfigType)*/, cb /*:(?Error, ?Function)
|
|||||||
Respond(void 0, dict);
|
Respond(void 0, dict);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// restricted to privileged users...
|
// restricted to privileged users...
|
||||||
case 'UPLOAD':
|
case 'UPLOAD':
|
||||||
if (!privileged) { return deny(); }
|
if (!privileged) { return deny(); }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user