|
|
@ -378,6 +378,7 @@ RPC.create = function (config, cb) {
|
|
|
|
|
|
|
|
|
|
|
|
var Env = {
|
|
|
|
var Env = {
|
|
|
|
historyKeeper: config.historyKeeper,
|
|
|
|
historyKeeper: config.historyKeeper,
|
|
|
|
|
|
|
|
intervals: config.intervals || {},
|
|
|
|
defaultStorageLimit: config.defaultStorageLimit,
|
|
|
|
defaultStorageLimit: config.defaultStorageLimit,
|
|
|
|
maxUploadSize: config.maxUploadSize || (20 * 1024 * 1024),
|
|
|
|
maxUploadSize: config.maxUploadSize || (20 * 1024 * 1024),
|
|
|
|
Sessions: {},
|
|
|
|
Sessions: {},
|
|
|
@ -388,7 +389,6 @@ RPC.create = function (config, cb) {
|
|
|
|
evPinnedPadsReady: mkEvent(true),
|
|
|
|
evPinnedPadsReady: mkEvent(true),
|
|
|
|
limits: {},
|
|
|
|
limits: {},
|
|
|
|
admins: [],
|
|
|
|
admins: [],
|
|
|
|
sessionExpirationInterval: undefined,
|
|
|
|
|
|
|
|
Log: Log,
|
|
|
|
Log: Log,
|
|
|
|
WARN: WARN,
|
|
|
|
WARN: WARN,
|
|
|
|
flushCache: config.flushCache,
|
|
|
|
flushCache: config.flushCache,
|
|
|
@ -427,7 +427,7 @@ RPC.create = function (config, cb) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
Quota.applyCustomLimits(Env);
|
|
|
|
Quota.applyCustomLimits(Env);
|
|
|
|
updateLimitDaily();
|
|
|
|
updateLimitDaily();
|
|
|
|
setInterval(updateLimitDaily, 24*3600*1000);
|
|
|
|
Env.intervals.dailyLimitUpdate = setInterval(updateLimitDaily, 24*3600*1000);
|
|
|
|
|
|
|
|
|
|
|
|
Pinning.loadChannelPins(Env);
|
|
|
|
Pinning.loadChannelPins(Env);
|
|
|
|
|
|
|
|
|
|
|
@ -458,8 +458,7 @@ RPC.create = function (config, cb) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
// expire old sessions once per minute
|
|
|
|
// expire old sessions once per minute
|
|
|
|
// XXX allow for graceful shutdown
|
|
|
|
Env.intervals.sessionExpirationInterval = setInterval(function () {
|
|
|
|
Env.sessionExpirationInterval = setInterval(function () {
|
|
|
|
|
|
|
|
Core.expireSessions(Sessions);
|
|
|
|
Core.expireSessions(Sessions);
|
|
|
|
}, Core.SESSION_EXPIRATION_TIME);
|
|
|
|
}, Core.SESSION_EXPIRATION_TIME);
|
|
|
|
});
|
|
|
|
});
|
|
|
|