improving time based data retrieval mechanism

This commit is contained in:
Miroslav Stampar 2011-04-17 07:24:18 +00:00
parent 5e70eac98c
commit 29ee760021
2 changed files with 8 additions and 2 deletions

View File

@ -1846,7 +1846,8 @@ 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 = "adjusting time delay to %d second%s " % (candidate, 's' if candidate > 1 else '')
warnMsg += "(due to good response times)"
logger.warn(warnMsg)
conf.timeSec = candidate

View File

@ -250,9 +250,14 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
logger.error(errMsg)
conf.timeSec += 1
warnMsg = "adjusting time delay to %d seconds" % conf.timeSec
warnMsg = "increasing time delay to %d second%s " % (conf.timeSec, 's' if conf.timeSec > 1 else '')
warnMsg += "(due to invalid char)"
logger.warn(warnMsg)
if kb.adjustTimeDelay:
dbgMsg = "turning off auto-adjustment mechanism"
logger.debug(dbgMsg)
kb.adjustTimeDelay = False
return getChar(idx, originalTbl, continuousOrder, expand)
else:
return decodeIntToUnicode(retVal)