Browse Source

"Solving" 5 minute timeout reopening the socket connection after 4 min

master
GabrielTrettel 3 years ago
parent
commit
3da0317a57
  1. 7
      src/app/hooks/useSocketMarkers.js

7
src/app/hooks/useSocketMarkers.js

@ -182,9 +182,12 @@ function getFormsAnswers(socketObject, dispatch) {
openListeners();
// Actually closing/opening sockets every 10min
// GATO 3: Actually closing/opening sockets every 4min
// This is a workaround to an instability in our cloud-server. It stops to
// send feedback data after ~4 minutes and they could not manage to solve. So
// we were told to "fix" this issue this way for a while.
useEffect(() => {
if (timerCounter % 10 == 0) {
if (timerCounter % 4 == 0) {
console.log(`========> Closing/Opening socket: ${socketObject.name} => ${moment().format('DD/MM, h:mm:ss:SSS')}`);
socketObject.socketUrl.close();
socketObject.socketUrl = new WebSocket(socketObject.url);

Loading…
Cancel
Save