Add a delay to calling client.disconnect as a workaround for it being called too early and websocket connection not being established.

This commit is contained in:
Jakub Filo 2023-04-30 16:43:59 +00:00
parent d8104cd70d
commit b04ba0b100
1 changed files with 3 additions and 1 deletions

View File

@ -127,7 +127,9 @@ async function run() {
const client = new Client(username, password);
await client.connect();
data.state = client.getState;
await client.disconnect();
setTimeout(async () => {
await client.disconnect();
}, 2000);
} catch (err) {
log.verbose("Failed to log in as new user, perhaps the password is wrong?");
log.silly(err);