moleculerjs / moleculer

:rocket: Progressive microservices framework for Node.js
https://moleculer.services/
MIT License
6.17k stars 587 forks source link

Default cache cleaner mixin not working #1279

Closed Kathir-1995 closed 7 months ago

Kathir-1995 commented 7 months ago
module.exports = function(serviceNames) { const events = {}; serviceNames.forEach(name => { events[`cache.clean.${name}`] = function() { if (this.broker.cacher) { this.logger.debug(`Clear local '${this.name}' cache`); this.broker.cacher.clean(`${this.name}.*`); } }; }); return { events };}; -- I have used the cache cleaner mixin in my service, After updating the data, still i am getting the cached data and the mixin was not properly cleared the cache. Anyone suggest solution for this issue?
icebob commented 7 months ago

cache cleaner just clear the cache entries if it receives the cache.clean.<servicename> event. Do you emit this event?