mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-25 14:47:45 -06:00
fix: Recovering messages lost with redis cache
This commit is contained in:
@@ -151,7 +151,7 @@ export class BaileysStartupService extends WAStartupService {
|
||||
const cacheConf = this.configService.get<CacheConf>('CACHE');
|
||||
|
||||
if ((cacheConf?.REDIS?.ENABLED && cacheConf?.REDIS?.URI !== '') || cacheConf?.LOCAL?.ENABLED) {
|
||||
setTimeout(async () => {
|
||||
setInterval(async () => {
|
||||
this.logger.info('Recovering messages');
|
||||
this.messagesLostCache.keys().then((keys) => {
|
||||
keys.forEach(async (key) => {
|
||||
|
||||
5
src/cache/cacheengine.ts
vendored
5
src/cache/cacheengine.ts
vendored
@@ -1,8 +1,11 @@
|
||||
import { ICache } from '../api/abstract/abstract.cache';
|
||||
import { CacheConf, ConfigService } from '../config/env.config';
|
||||
import { Logger } from '../config/logger.config';
|
||||
import { LocalCache } from './localcache';
|
||||
import { RedisCache } from './rediscache';
|
||||
|
||||
const logger = new Logger('Redis');
|
||||
|
||||
export class CacheEngine {
|
||||
private engine: ICache;
|
||||
|
||||
@@ -14,6 +17,8 @@ export class CacheEngine {
|
||||
} else if (cacheConf?.LOCAL?.ENABLED) {
|
||||
this.engine = new LocalCache(configService, module);
|
||||
}
|
||||
|
||||
logger.info(`RedisCache initialized for ${module}`);
|
||||
}
|
||||
|
||||
public getEngine() {
|
||||
|
||||
Reference in New Issue
Block a user