Closed jaumard closed 7 years ago
This apply that your current implementation of singleton @maissani is no more correct. Because with your actual implementation you have only one singleton where in my proposal you'll have one singleton per store
any date about this issue @maissani ? it make this trailpack useless when you want to use multiple store separately (because you can't retrieve them at all separately)
Little up here :)
Ok I did into the code a little a I think the usage of multicache is wrong here https://github.com/trailsjs/trailpack-cache/blob/master/api/services/CacheService.js#L64
Because if I have multi store like mongo, memory and fs and do
getCaches('fs')
, it will not return me a fs cache, it will return a multicache instance witch use all stores. That's not what I want at all. I want to be able to use store separately witch is currently not possible with this implementation.My proposal is :
getCaches()
=> return multicache instance if multiple storegetCaches(name)
=> return single instance of the given store name