diff --git a/lib/controller/checks.py b/lib/controller/checks.py index b6901f923..8bb320531 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -1015,11 +1015,15 @@ def checkStability(): like for instance string matching (--string). """ - infoMsg = "testing if the target URL is stable. This can take a couple of seconds" + infoMsg = "testing if the target URL is stable. This can take up to a second" logger.info(infoMsg) firstPage = kb.originalPage # set inside checkConnection() - time.sleep(1) + + delay = 1 - (time.time() - (kb.originalPageTime or 0)) + delay = max(0, min(1, delay)) + time.sleep(delay) + secondPage, _ = Request.queryPage(content=True, raise404=False) if kb.redirectChoice: @@ -1306,6 +1310,7 @@ def checkConnection(suppressOutput=False): try: page, _ = Request.queryPage(content=True, noteResponseTime=False) kb.originalPage = kb.pageTemplate = page + kb.originalPageTime = time.time() kb.errorIsNone = False diff --git a/lib/core/option.py b/lib/core/option.py index c5b681d4b..97f211e17 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1819,6 +1819,7 @@ def _setKnowledgeBaseAttributes(flushAll=True): kb.orderByColumns = None kb.originalCode = None kb.originalPage = None + kb.originalPageTime = None kb.originalTimeDelay = None kb.originalUrls = dict()