implement shared environment between historyKeeper and RPC
This commit is contained in:
@@ -23,7 +23,7 @@ Channel.clearOwnedChannel = function (Env, safeKey, channelId, cb, Server) {
|
||||
if (e) { return void cb(e); }
|
||||
cb();
|
||||
|
||||
const channel_cache = Env.historyKeeper.channel_cache;
|
||||
const channel_cache = Env.channel_cache;
|
||||
|
||||
const clear = function () {
|
||||
// delete the channel cache because it will have been invalidated
|
||||
@@ -117,8 +117,8 @@ Channel.removeOwnedChannel = function (Env, safeKey, channelId, cb, Server) {
|
||||
}
|
||||
cb(void 0, 'OK');
|
||||
|
||||
const channel_cache = Env.historyKeeper.channel_cache;
|
||||
const metadata_cache = Env.historyKeeper.metadata_cache;
|
||||
const channel_cache = Env.channel_cache;
|
||||
const metadata_cache = Env.metadata_cache;
|
||||
|
||||
const clear = function () {
|
||||
delete channel_cache[channelId];
|
||||
@@ -187,8 +187,8 @@ Channel.trimHistory = function (Env, safeKey, data, cb) {
|
||||
// clear historyKeeper's cache for this channel
|
||||
Env.historyKeeper.channelClose(channelId);
|
||||
cb(void 0, 'OK');
|
||||
delete Env.historyKeeper.channel_cache[channelId];
|
||||
delete Env.historyKeeper.metadata_cache[channelId];
|
||||
delete Env.channel_cache[channelId];
|
||||
delete Env.metadata_cache[channelId];
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user