mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
fix server logic and logs messages related to quotas
This commit is contained in:
parent
576b034547
commit
2b365694f6
@ -189,8 +189,9 @@ var queryQuotaServer = function (Env, cb) {
|
||||
let url = new URL(Env.accounts_api);
|
||||
if (!['https:', 'http:'].includes(url.protocol)) { throw new Error("INVALID_PROTOCOL"); }
|
||||
if (url.protocol === 'http:') { H = Http; }
|
||||
if (typeof(url.port) === 'number') { options.port = url.port; }
|
||||
options.host = url.host;
|
||||
let port = Number(url.port);
|
||||
if (port && typeof(port) === 'number') { options.port = port; }
|
||||
options.host = url.hostname;
|
||||
Env.Log.info("USING_CUSTOM_ACCOUNTS_API", {
|
||||
value: Env.accounts_api,
|
||||
});
|
||||
@ -241,7 +242,7 @@ Quota.updateCachedLimits = function (Env, _cb) {
|
||||
|
||||
Quota.applyCustomLimits(Env);
|
||||
|
||||
if (!Env.allowSubscriptions && !Env.accounts_api) { return void cb(); }
|
||||
if (!Env.allowSubscriptions || !Env.accounts_api) { return void cb(); }
|
||||
Quota.queryQuotaServer(Env, function (err, json) {
|
||||
if (err) { return void cb(err); }
|
||||
if (!json) { return void cb(); }
|
||||
|
||||
@ -205,7 +205,7 @@ RPC.create = function (Env, cb) {
|
||||
// failure is expected if they have not specified a quota API endpoint
|
||||
if (!Env.accounts_api) { return; }
|
||||
if (e) {
|
||||
Env.WARN('limitUpdate', e);
|
||||
Env.WARN('LIMIT_UPDATE', e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user