From 2f5ca9604f29bc6d0d02288491e8db48eaffc85b Mon Sep 17 00:00:00 2001 From: Alexandru Date: Tue, 10 Dec 2024 22:25:24 +0200 Subject: [PATCH] More delays --- popup.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/popup.js b/popup.js index 5075336..ba53f8d 100644 --- a/popup.js +++ b/popup.js @@ -57,7 +57,7 @@ function getDynamicUrl() { async function checkRoute(origin, destination, date) { try { - const delay = Math.floor(Math.random() * (300 - 50 + 1)) + 50; + const delay = Math.floor(Math.random() * (300 - 50 + 1)) + 100; await new Promise((resolve) => setTimeout(resolve, delay)); const dynamicUrl = await getDynamicUrl(); @@ -204,9 +204,9 @@ async function checkAllRoutes() { for (const destination of destinations) { if (isRateLimited) break; - if (completedRoutes > 0 && completedRoutes % 30 === 0) { - progressElement.textContent = `Taking a 5 second break to avoid rate limiting...`; - await new Promise(resolve => setTimeout(resolve, 5000)); + if (completedRoutes > 0 && completedRoutes % 25 === 0) { + progressElement.textContent = `Taking a 15 second break to avoid rate limiting...`; + await new Promise(resolve => setTimeout(resolve, 15000)); } const updateProgress = () => {