Ask the user wheather or not to adjust the time delay - there have been a case where the forcing of conf.timeSec screwed the result in an extremely lagged and unreliable site

This commit is contained in:
Bernardo Damele 2011-08-12 13:06:40 +00:00
parent 997c9ba1e8
commit 36280b33fa

View File

@ -2098,11 +2098,12 @@ def adjustTimeDelay(lastQueryDuration, lowerStdLimit):
if all([x == candidate for x in kb.delayCandidates]) and candidate < conf.timeSec:
print
warnMsg = "adjusting time delay to %d second%s " % (candidate, 's' if candidate > 1 else '')
warnMsg += "(due to good response times)"
logger.warn(warnMsg)
msg = "do you want to adjust the time delay to %d second%s " % (candidate, 's' if candidate > 1 else '')
msg += "(due to good response times)? [Y/n] "
inp = readInput(msg, default="Y")
conf.timeSec = candidate
if inp and inp[0].lower() == "y":
conf.timeSec = candidate
def extractErrorMessage(page):
"""