diff --git a/lib/core/agent.py b/lib/core/agent.py index 5c276bc76..9e78578ba 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -242,6 +242,13 @@ class Agent: return payload + def adjustSleepTime(self, payload): + """ + Returns payload with a replaced tag for SLEEPTIME + """ + + return payload.replace("[SLEEPTIME]", str(conf.timeSec)) if payload else payload + def getComment(self, request): """ Returns comment form for the given request diff --git a/lib/request/connect.py b/lib/request/connect.py index 858b60427..b926060ba 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -521,7 +521,7 @@ class Connect: raise404 = place != PLACE.URI if raise404 is None else raise404 - value = value.replace("[SLEEPTIME]", str(conf.timeSec)) if value else value + value = agent.adjustSleepTime(value) payload = agent.extractPayload(value) threadData = getCurrentThreadData() diff --git a/lib/request/direct.py b/lib/request/direct.py index 293b7105b..99c099fc6 100644 --- a/lib/request/direct.py +++ b/lib/request/direct.py @@ -28,7 +28,7 @@ from lib.utils.timeout import timeout def direct(query, content=True): select = True query = agent.payloadDirect(query) - query = query.replace("[SLEEPTIME]", str(conf.timeSec)) + query = agent.adjustSleepTime(query) threadData = getCurrentThreadData() if Backend.isDbms(DBMS.ORACLE) and query.startswith("SELECT ") and " FROM " not in query: