Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async relogin() {
this.currentCancel.cancel()
this.currentCancel = new CancellationTokenSource()
this.currentCall = Promise.resolve()
if (this.mainClient.stateful === session_types.stateful) {
try {
this.mainClient.stateful = session_types.stateless
// juts in case I have pending locks...
await this.mainClient.logout()
} catch (error) {
// ignore
}
await this.mainClient.login()
}
}
async client => (client.stateful = session_types.stateless)
)