finally untangle metadata and index caches

This commit is contained in:
ansuz
2020-03-04 12:56:33 -05:00
parent 32d769447a
commit 9d8bb43d03
2 changed files with 80 additions and 106 deletions

View File

@@ -139,16 +139,10 @@ Data.setMetadata = function (Env, safeKey, data, cb, Server) {
next();
const metadata_cache = Env.metadata_cache;
const channel_cache = Env.channel_cache;
// update the cached metadata
metadata_cache[channel] = metadata;
// as well as the metadata that's attached to the index...
// XXX determine if we actually need this...
var index = Util.find(channel_cache, [channel, 'index']);
if (index && typeof(index) === 'object') { index.metadata = metadata; }
// it's easy to check if the channel is restricted
const isRestricted = metadata.restricted;
// and these values will be used in any case