File tree Expand file tree Collapse file tree 6 files changed +13
-0
lines changed
evolution-api-all-services Expand file tree Collapse file tree 6 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ LOG_BAILEYS=error
1616# Default time: 5 minutes
1717# If you don't even want an expiration, enter the value false
1818DEL_INSTANCE = false
19+ DEL_TEMP_INSTANCES = true # Delete instances with status closed on start
1920
2021# Temporary data storage
2122STORE_MESSAGES = true
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ LOG_BAILEYS=error
1616# Default time: 5 minutes
1717# If you don't even want an expiration, enter the value false
1818DEL_INSTANCE = false
19+ DEL_TEMP_INSTANCES = true # Delete instances with status closed on start
1920
2021# Temporary data storage
2122STORE_MESSAGES = true
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ ENV LOG_COLOR=true
3535ENV LOG_BAILEYS=error
3636
3737ENV DEL_INSTANCE=false
38+ ENV DEL_TEMP_INSTANCES=true
3839
3940ENV STORE_MESSAGES=true
4041ENV STORE_MESSAGE_UP=true
Original file line number Diff line number Diff line change @@ -189,6 +189,7 @@ export interface Env {
189189 WA_BUSINESS : WaBusiness ;
190190 LOG : Log ;
191191 DEL_INSTANCE : DelInstance ;
192+ DEL_TEMP_INSTANCES : boolean ;
192193 LANGUAGE : Language ;
193194 WEBHOOK : Webhook ;
194195 CONFIG_SESSION_PHONE : ConfigSessionPhone ;
@@ -317,6 +318,9 @@ export class ConfigService {
317318 DEL_INSTANCE : isBooleanString ( process . env ?. DEL_INSTANCE )
318319 ? process . env . DEL_INSTANCE === 'true'
319320 : Number . parseInt ( process . env . DEL_INSTANCE ) || false ,
321+ DEL_TEMP_INSTANCES : isBooleanString ( process . env ?. DEL_TEMP_INSTANCES )
322+ ? process . env . DEL_TEMP_INSTANCES === 'true'
323+ : true ,
320324 LANGUAGE : process . env ?. LANGUAGE || 'en' ,
321325 WEBHOOK : {
322326 GLOBAL : {
Original file line number Diff line number Diff line change 4747# Default time: 5 minutes
4848# If you don't even want an expiration, enter the value false
4949DEL_INSTANCE : false # or false
50+ DEL_TEMP_INSTANCES : true # Delete instances with status closed on start
5051
5152# Temporary data storage
5253STORE :
Original file line number Diff line number Diff line change @@ -480,6 +480,11 @@ export class WAMonitoringService {
480480 }
481481
482482 private async deleteTempInstances ( collections : Collection < Document > [ ] ) {
483+ const shouldDelete = this . configService . get < boolean > ( 'DEL_TEMP_INSTANCES' ) ;
484+ if ( ! shouldDelete ) {
485+ this . logger . verbose ( 'Temp instances deletion is disabled' ) ;
486+ return ;
487+ }
483488 this . logger . verbose ( 'Cleaning up temp instances' ) ;
484489 const auths = await this . repository . auth . list ( ) ;
485490 if ( auths . length === 0 ) {
You can’t perform that action at this time.
0 commit comments