.open() .then(connection => { this.connection = connection;
async connect() { try { const data = this.connectionData; const connection = new Connection({ ...data, reconnect: false, }); this.connection = await connection.open(); } catch (error) { this.tentatives += 1 if (this.tentatives > 3) { console.log('maximum tentatives excedeed', this.tentatives) throw error } console.log('trying to connect again, waiting a second') await QueueHandler.sleep(1000) return this.connect() } }