node-shared-cache
node-shared-cache copied to clipboard
Does not work on OSX
The node process hangs hard on OSX when attempting to write to a cache or enumerate the keys. Is this intentional? If only Linux is supported, please update the readme to indicate such. Thanks!
Hey, I have just tested on osx and all works fine for me. Could you supply a little more specific information why it does not work?
const memory_cache = require('node-shared-cache');
const logger=console;
var card_cache;
try{
//memory_cache.release('prod');
card_cache = new memory_cache.Cache("prod", 654321);
}catch(ex){
logger.log('new memory_cache.Cache("prod").ex=',ex);
memory_cache.release('prod');
card_cache = new memory_cache.Cache("prod", 654321);
}
function _checkCache(){
var _size=0;
for(var i in card_cache){
_size++;
}
card_cache['_'+Math.floor(Math.random()*10000)]=(new Date()).getTime();
logger.log('card_cache _size=',_size);
setTimeout(()=>{
_checkCache();
},3333);
}
_checkCache();
the error is:
new memory_cache.Cache("prod").ex= Error: cache initialized with different size
seems two differnt process cannot share one cache at OSX