Don't re-add + log MCI cache if already cached. Also fix wording :)
This commit is contained in:
parent
470897eadc
commit
82533eae2d
|
@ -256,16 +256,17 @@ function display(client, art, options, cb) {
|
||||||
let mciMap;
|
let mciMap;
|
||||||
const mciCprQueue = [];
|
const mciCprQueue = [];
|
||||||
let artHash;
|
let artHash;
|
||||||
|
let mciMapFromCache;
|
||||||
|
|
||||||
function completed() {
|
function completed() {
|
||||||
if(cprListener) {
|
if(cprListener) {
|
||||||
client.removeListener('cursor position report', cprListener);
|
client.removeListener('cursor position report', cprListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!options.disableMciCache) {
|
if(!options.disableMciCache && !mciMapFromCache) {
|
||||||
// cache our MCI findings...
|
// cache our MCI findings...
|
||||||
client.mciCache[artHash] = mciMap;
|
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???
|
ansiParser.removeAllListeners(); // :TODO: Necessary???
|
||||||
|
@ -288,6 +289,7 @@ function display(client, art, options, cb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mciMap) {
|
if(mciMap) {
|
||||||
|
mciMapFromCache = true;
|
||||||
client.log.trace( { artHash : artHash, mciMap : mciMap }, 'Loaded MCI map from cache');
|
client.log.trace( { artHash : artHash, mciMap : mciMap }, 'Loaded MCI map from cache');
|
||||||
} else {
|
} else {
|
||||||
// no cached MCI info
|
// no cached MCI info
|
||||||
|
|
Loading…
Reference in New Issue