add heartbeat global

This commit is contained in:
bee 2022-03-01 19:59:20 -08:00
parent 5622037719
commit 99affbb674
No known key found for this signature in database
GPG key ID: 70EECBF29DA75D8B

View file

@ -18,7 +18,7 @@ function WebSocketClient(url) {
clearTimeout(timeout)
timeout = undefined
}
timeout = setTimeout(() => client.terminate(), 350000)
timeout = setTimeout(() => client.terminate(), process.env.heartbeat || 350000)
}
client.on('ping', () => {
console.log(`::SimplyWS:: [${timestamp()}] pinged`)