define all server intervals in a map so we can easily clear them all
This commit is contained in:
@@ -378,6 +378,7 @@ RPC.create = function (config, cb) {
|
||||
|
||||
var Env = {
|
||||
historyKeeper: config.historyKeeper,
|
||||
intervals: config.intervals || {},
|
||||
defaultStorageLimit: config.defaultStorageLimit,
|
||||
maxUploadSize: config.maxUploadSize || (20 * 1024 * 1024),
|
||||
Sessions: {},
|
||||
@@ -388,7 +389,6 @@ RPC.create = function (config, cb) {
|
||||
evPinnedPadsReady: mkEvent(true),
|
||||
limits: {},
|
||||
admins: [],
|
||||
sessionExpirationInterval: undefined,
|
||||
Log: Log,
|
||||
WARN: WARN,
|
||||
flushCache: config.flushCache,
|
||||
@@ -427,7 +427,7 @@ RPC.create = function (config, cb) {
|
||||
};
|
||||
Quota.applyCustomLimits(Env);
|
||||
updateLimitDaily();
|
||||
setInterval(updateLimitDaily, 24*3600*1000);
|
||||
Env.intervals.dailyLimitUpdate = setInterval(updateLimitDaily, 24*3600*1000);
|
||||
|
||||
Pinning.loadChannelPins(Env);
|
||||
|
||||
@@ -458,8 +458,7 @@ RPC.create = function (config, cb) {
|
||||
}
|
||||
});
|
||||
// expire old sessions once per minute
|
||||
// XXX allow for graceful shutdown
|
||||
Env.sessionExpirationInterval = setInterval(function () {
|
||||
Env.intervals.sessionExpirationInterval = setInterval(function () {
|
||||
Core.expireSessions(Sessions);
|
||||
}, Core.SESSION_EXPIRATION_TIME);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user