xep_0030: asyncio.wait takes tasks
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
af07864cbb
commit
5c19f16287
1 changed files with 3 additions and 3 deletions
|
@ -315,13 +315,13 @@ class XEP_0030(BasePlugin):
|
||||||
domain = self.xmpp.boundjid.domain
|
domain = self.xmpp.boundjid.domain
|
||||||
|
|
||||||
if not cached or domain not in self.domain_infos:
|
if not cached or domain not in self.domain_infos:
|
||||||
infos = [self.get_info(
|
infos = [asyncio.create_task(self.get_info(
|
||||||
domain, timeout=timeout, **iqkwargs)]
|
domain, timeout=timeout, **iqkwargs))]
|
||||||
iq_items = await self.get_items(
|
iq_items = await self.get_items(
|
||||||
domain, timeout=timeout, **iqkwargs)
|
domain, timeout=timeout, **iqkwargs)
|
||||||
items = iq_items['disco_items']['items']
|
items = iq_items['disco_items']['items']
|
||||||
infos += [
|
infos += [
|
||||||
self.get_info(item[0], timeout=timeout, **iqkwargs)
|
asyncio.create_task(self.get_info(item[0], timeout=timeout, **iqkwargs))
|
||||||
for item in items]
|
for item in items]
|
||||||
info_futures, _ = await asyncio.wait(
|
info_futures, _ = await asyncio.wait(
|
||||||
infos,
|
infos,
|
||||||
|
|
Loading…
Reference in a new issue