fix: clean instance without chatwoot

This commit is contained in:
João Victor Souza 2024-09-11 11:03:38 -03:00
parent 9f30c7b160
commit 918cf295ad

View File

@ -148,7 +148,9 @@ export class WAMonitoringService {
}
public async cleaningStoreData(instanceName: string) {
execSync(`rm -rf ${join(STORE_DIR, 'chatwoot', instanceName + '*')}`);
if (this.configService.get<Chatwoot>('CHATWOOT').ENABLED) {
execSync(`rm -rf ${join(STORE_DIR, 'chatwoot', instanceName + '*')}`);
}
const instance = await this.prismaRepository.instance.findFirst({
where: { name: instanceName },