bot: Bugfix query timeout handling.
This commit is contained in:
parent
d522327e2d
commit
74cdc1e4a8
1 changed files with 2 additions and 2 deletions
|
@ -49,7 +49,7 @@ class ForwardBot(slixmpp.ClientXMPP):
|
|||
query['host'], error.iq['error']['condition'])
|
||||
except IqTimeout:
|
||||
try:
|
||||
wait_secs = query['wait_secs'] * 2
|
||||
wait_secs = min(query['wait_secs'] * 2, self.MAX_QUERY_WAIT)
|
||||
except KeyError:
|
||||
wait_secs = 10
|
||||
logger.warning("queryhost: timeout querying %r: will retry in %s seconds",
|
||||
|
@ -57,7 +57,7 @@ class ForwardBot(slixmpp.ClientXMPP):
|
|||
new_query = query.copy()
|
||||
new_query['wait_secs'] = wait_secs
|
||||
await asyncio.sleep(wait_secs)
|
||||
self.event('forward::queryhost', query)
|
||||
self.event('forward::queryhost', new_query)
|
||||
else:
|
||||
if self.MUC_FEATURE in result['disco_info']['features']:
|
||||
logmsg = "is MUC host, joining rooms"
|
||||
|
|
Loading…
Reference in a new issue