From 5c8b5b7b63c90643f4389545931f669ebea012d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 1 Jun 2020 11:51:40 +0300 Subject: [PATCH] adaptiveSetInterval fires the first request immediately if runNow is true, in 3 seconds otherwise. --- static/js/adaptive-setinterval.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/static/js/adaptive-setinterval.js b/static/js/adaptive-setinterval.js index ff23c682..4a34e750 100644 --- a/static/js/adaptive-setinterval.js +++ b/static/js/adaptive-setinterval.js @@ -40,8 +40,6 @@ function adaptiveSetInterval(fn, runNow) { } }); - if (runNow) { - quota = 20; - scheduleRun(); - } + quota = 20; + scheduledId = setTimeout(scheduleRun, runNow ? 1 : 3000); }