Commit 8f4d0dc9 authored by Yoann HOUPERT's avatar Yoann HOUPERT
Browse files

replace recursive timeout init recommendation by interval

parent 3cc24a3e
...@@ -144,13 +144,12 @@ robot = { ...@@ -144,13 +144,12 @@ robot = {
robot.checkDisconnect(); robot.checkDisconnect();
}; };
function recoStartRetry() { const recoStartRetry = () => {
if (!robotLib.reco.start(room)) { if (robotLib.reco.start(room)) {
setTimeout(recoStartRetry, 8000); clearInterval(robot.recoInterval);
} }
} };
// If start fails, schedule retry at fixed interval until success robot.recoInterval = setInterval(recoStartRetry, 8000);
recoStartRetry();
setInterval( setInterval(
() => robotLib.reco.getOnlineReco(room) () => robotLib.reco.getOnlineReco(room)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment