add max query response time + update package

This commit is contained in:
Adhiraj Singh
2021-06-16 11:59:21 +05:30
parent 1c8d7df829
commit 3607357152
3 changed files with 5 additions and 2 deletions

View File

@@ -46,6 +46,7 @@ export class WAConnection extends EventEmitter {
maxRetries: 10,
connectCooldownMs: 4000,
phoneResponseTime: 15_000,
maxQueryResponseTime: 10_000,
alwaysUseTakeover: true,
queryChatsTillReceived: true
}
@@ -280,7 +281,7 @@ export class WAConnection extends EventEmitter {
timeout = setTimeout(() => {
this.logger.info({ tag }, `cancelling wait for message as a response is no longer expected from the phone`)
cancel({ reason: 'Not expecting a response', status: 422 })
}, 5_000)
}, this.connectOptions.maxQueryResponseTime)
this.off('connection-phone-change', listener)
}
}