|
|
@ -8,7 +8,7 @@ const Package = require('../../package.json');
|
|
|
|
const Https = require("https");
|
|
|
|
const Https = require("https");
|
|
|
|
const Util = require("../common-util");
|
|
|
|
const Util = require("../common-util");
|
|
|
|
|
|
|
|
|
|
|
|
var validLimitFields = ['limit', 'plan', 'note', 'users'];
|
|
|
|
var validLimitFields = ['limit', 'plan', 'note', 'users', 'origin'];
|
|
|
|
|
|
|
|
|
|
|
|
Quota.isValidLimit = function (o) {
|
|
|
|
Quota.isValidLimit = function (o) {
|
|
|
|
var valid = o && typeof(o) === 'object' &&
|
|
|
|
var valid = o && typeof(o) === 'object' &&
|
|
|
@ -137,7 +137,14 @@ Quota.updateCachedLimits = function (Env, cb) {
|
|
|
|
if (err) { return void cb(err); }
|
|
|
|
if (err) { return void cb(err); }
|
|
|
|
if (!json) { return void cb(); }
|
|
|
|
if (!json) { return void cb(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var k in json) {
|
|
|
|
|
|
|
|
if (k.length === 44 && json[k]) {
|
|
|
|
|
|
|
|
json[k].origin = 'remote';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Env.limits = json;
|
|
|
|
Env.limits = json;
|
|
|
|
|
|
|
|
|
|
|
|
Quota.applyCustomLimits(Env);
|
|
|
|
Quota.applyCustomLimits(Env);
|
|
|
|
cb();
|
|
|
|
cb();
|
|
|
|
});
|
|
|
|
});
|
|
|
|