jaredwray / flat-cache

A stupidly simple key/value storage using files to persist the data
MIT License
165 stars 30 forks source link

ClearAll not working #21

Closed morwalz closed 1 year ago

morwalz commented 6 years ago

Hi Function clear all not working

royriojas commented 5 years ago

Sorry somehow this issue went unnoticed. Do you think you can provide a repro case of this issue?

I noticed there is no test covering clearAll so it might actually be happening.

fazulk commented 5 years ago

I noticed the function removes the file, But somehow cache.getKey(key) is still able to locate the key in memory.

aryak007 commented 5 years ago

Please fix this as soon as possible. Even clearCacheById is not working for me.

Thanks

morwalz commented 5 years ago

@royriojas It is simple. this function at all does not work

nysky1 commented 5 years ago

Doesn't this pretty much ruin the module?

vndevil commented 5 years ago

You have to provide folder cache path, example:

const flatCache = require('flat-cache');
const flatCacheFolderPath = './src/Server/Config/_flat-cache';
...
flatCache.clearAll(flatCacheFolderPath); // remove the cache directory