Stop connection before starting, just in case

This commit is contained in:
Christopher Cookman 2024-05-08 07:48:05 -06:00
parent e93b08d835
commit f4fa286766
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -239,13 +239,14 @@ xmpp.on("online", async (address) => {
}); });
const start = () => { const start = () => {
xmpp.start().catch((err) => { xmpp.stop().then(() => {
console.error(`start failed, ${err}\nGonna try again in 5 seconds...`); xmpp.start().catch((err) => {
xmpp.stop(); console.error(`start failed, ${err}\nGonna try again in 5 seconds...`);
setTimeout(() => { setTimeout(() => {
start(); start();
}, 5000); }, 5000);
}); });
}); // Do this just in case
} }
// END XMPP // END XMPP