Merge pull request #461 from judsonjuniorr/refactor/temp_delete_option

Refactor/temp delete option
This commit is contained in:
Davidson Gomes
2024-03-07 19:59:17 -03:00
committed by GitHub
6 changed files with 13 additions and 0 deletions

View File

@@ -480,6 +480,11 @@ export class WAMonitoringService {
}
private async deleteTempInstances(collections: Collection<Document>[]) {
const shouldDelete = this.configService.get<boolean>('DEL_TEMP_INSTANCES');
if (!shouldDelete) {
this.logger.verbose('Temp instances deletion is disabled');
return;
}
this.logger.verbose('Cleaning up temp instances');
const auths = await this.repository.auth.list();
if (auths.length === 0) {