Don't re-add + log MCI cache if already cached. Also fix wording :)

This commit is contained in:
Bryan Ashby 2016-09-01 23:57:57 -06:00
parent 470897eadc
commit 82533eae2d
1 changed files with 5 additions and 3 deletions

View File

@ -256,16 +256,17 @@ function display(client, art, options, cb) {
let mciMap;
const mciCprQueue = [];
let artHash;
let mciMapFromCache;
function completed() {
if(cprListener) {
client.removeListener('cursor position report', cprListener);
}
if(!options.disableMciCache) {
if(!options.disableMciCache && !mciMapFromCache) {
// cache our MCI findings...
client.mciCache[artHash] = mciMap;
client.log.trace( { artHash : artHash, mciMap : mciMap }, 'Added MCI map from cache');
client.log.trace( { artHash : artHash, mciMap : mciMap }, 'Added MCI map to cache');
}
ansiParser.removeAllListeners(); // :TODO: Necessary???
@ -288,6 +289,7 @@ function display(client, art, options, cb) {
}
if(mciMap) {
mciMapFromCache = true;
client.log.trace( { artHash : artHash, mciMap : mciMap }, 'Loaded MCI map from cache');
} else {
// no cached MCI info