mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2026-01-10 22:02:21 -06:00
feat(cacheservice): add suport to use use redis in cacheservice
This commit is contained in:
@@ -131,6 +131,7 @@ import { MessageUpQuery } from '../repository/messageUp.repository';
|
||||
import { RepositoryBroker } from '../repository/repository.manager';
|
||||
import { Events, MessageSubtype, TypeMediaMessage, wa } from '../types/wa.types';
|
||||
import { waMonitor } from '../whatsapp.module';
|
||||
import { CacheService } from './cache.service';
|
||||
import { ChamaaiService } from './chamaai.service';
|
||||
import { ChatwootService } from './chatwoot.service';
|
||||
import { TypebotService } from './typebot.service';
|
||||
@@ -143,6 +144,7 @@ export class WAStartupService {
|
||||
private readonly eventEmitter: EventEmitter2,
|
||||
private readonly repository: RepositoryBroker,
|
||||
private readonly cache: RedisCache,
|
||||
private readonly chatwootCache: CacheService,
|
||||
) {
|
||||
this.logger.verbose('WAStartupService initialized');
|
||||
this.cleanStore();
|
||||
@@ -170,7 +172,7 @@ export class WAStartupService {
|
||||
|
||||
private phoneNumber: string;
|
||||
|
||||
private chatwootService = new ChatwootService(waMonitor, this.configService, this.repository);
|
||||
private chatwootService = new ChatwootService(waMonitor, this.configService, this.repository, this.chatwootCache);
|
||||
|
||||
private typebotService = new TypebotService(waMonitor, this.configService, this.eventEmitter);
|
||||
|
||||
@@ -408,7 +410,7 @@ export class WAStartupService {
|
||||
this.logger.verbose('Removing cache from chatwoot');
|
||||
|
||||
if (this.localChatwoot.enabled) {
|
||||
this.chatwootService.getCache().deleteAll();
|
||||
this.chatwootService.getCache()?.deleteAll(this.instanceName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user