bot: Bugfix query timeout handling.

This commit is contained in:
Brett Smith 2020-04-20 09:19:59 -04:00
parent d522327e2d
commit 74cdc1e4a8

View file

@ -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"