moleculerjs / moleculer-db

:battery: Database access service mixins for Moleculer
https://moleculer.services/
MIT License
152 stars 121 forks source link

Problems with cache #30

Open NsSumse opened 6 years ago

NsSumse commented 6 years ago

When I have a version in my service the clearCache doesn't work anymore.

The problem in the code

/**
 * Clear cached entities
 *
 * @methods
 * @returns {Promise}
 */
clearCache() {
    var version = this.version ? this.version + '.' : '';
    this.broker.broadcast(`cache.clean.${version}${this.name}`);
    if (this.broker.cacher) {
        // version is missing

        this.broker.cacher.clean(`${version}${this.name}.*`);
    }
    return Promise.resolve();
},
aliazlan4 commented 5 years ago

I have resolved this issue in the following PR

https://github.com/moleculerjs/moleculer-db/pull/85