Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
new Promise((resolve) => {
// console.log(`OPEN: ${roomid}`)
const live = new LiveTCP(roomid)
rooms[roomid] = live
let lastHeartbeat = 0
const autorestart = setTimeout(() => {
// console.log(`AUTORESTART: ${roomid}`)
live.close()
}, 1000 * 60 * 60 * 18)
let timeout = setTimeout(() => {
if (new Date().getTime() - lastHeartbeat > 1000 * 30) {
// console.log(`TIMEOUT: ${roomid}`)
live.close()
}
}, 1000 * 45)
live.once('live', () => {
// console.log(`READY: ${roomid}`)
})
live.on('LIVE', () =>