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 = {
robot.checkDisconnect();
};
function recoStartRetry() {
if (!robotLib.reco.start(room)) {
setTimeout(recoStartRetry, 8000);
const recoStartRetry = () => {
if (robotLib.reco.start(room)) {
clearInterval(robot.recoInterval);
}
}
// If start fails, schedule retry at fixed interval until success
recoStartRetry();
};
robot.recoInterval = setInterval(recoStartRetry, 8000);
setInterval(
() => 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