forked from ChrisChrome/weather-bot
		
	Stop connection before starting, just in case
This commit is contained in:
		
							parent
							
								
									e93b08d835
								
							
						
					
					
						commit
						f4fa286766
					
				
							
								
								
									
										3
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								index.js
									
									
									
									
									
								
							|  | @ -239,13 +239,14 @@ xmpp.on("online", async (address) => { | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| const start = () => { | const start = () => { | ||||||
|  | 	xmpp.stop().then(() => { | ||||||
| 		xmpp.start().catch((err) => { | 		xmpp.start().catch((err) => { | ||||||
| 			console.error(`start failed, ${err}\nGonna try again in 5 seconds...`); | 			console.error(`start failed, ${err}\nGonna try again in 5 seconds...`); | ||||||
| 		xmpp.stop(); |  | ||||||
| 			setTimeout(() => { | 			setTimeout(() => { | ||||||
| 				start(); | 				start(); | ||||||
| 			}, 5000); | 			}, 5000); | ||||||
| 		}); | 		}); | ||||||
|  | 	}); // Do this just in case
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // END XMPP
 | // END XMPP
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue