Replace ensure_future calls with create_task
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
fa3e690154
commit
02b3380ac3
2 changed files with 5 additions and 4 deletions
|
@ -2,6 +2,7 @@ Version xxx:
|
|||
2022-xx-xx Maxime “pep” Buquet <pep@bouah.net>
|
||||
* Added:
|
||||
- Coroutines in asyncio.wait is now deprecated. Added create_task calls
|
||||
- Replaced all ensure_future calls by create_task
|
||||
Version 0.8.0:
|
||||
2022-08-23 Maxime “pep” Buquet <pep@bouah.net>
|
||||
* Breaking:
|
||||
|
|
|
@ -236,7 +236,7 @@ class XEP_0384(BasePlugin):
|
|||
"no data directory specified.")
|
||||
|
||||
self._device_id = _load_device_id(self.data_dir)
|
||||
asyncio.ensure_future(self.session_start_omemo())
|
||||
asyncio.create_task(self.session_start_omemo())
|
||||
|
||||
self.xmpp.add_event_handler('session_start', self.session_start)
|
||||
self.xmpp['xep_0060'].map_node_event(OMEMO_DEVICES_NS, 'omemo_device_list')
|
||||
|
@ -245,7 +245,7 @@ class XEP_0384(BasePlugin):
|
|||
# If this plugin is loaded after 'session_start' has fired, we still
|
||||
# need to publish bundles
|
||||
if self.xmpp.is_connected and not self._initial_publish_done:
|
||||
asyncio.ensure_future(self._initial_publish())
|
||||
asyncio.create_task(self._initial_publish())
|
||||
|
||||
def plugin_end(self):
|
||||
if not self.backend_loaded:
|
||||
|
@ -469,7 +469,7 @@ class XEP_0384(BasePlugin):
|
|||
|
||||
def _receive_device_list(self, msg: Message) -> None:
|
||||
"""Handler for received PEP OMEMO_DEVICES_NS payloads"""
|
||||
asyncio.ensure_future(
|
||||
asyncio.create_task(
|
||||
self._read_device_list(msg['from'], msg['pubsub_event']['items']),
|
||||
)
|
||||
|
||||
|
@ -755,7 +755,7 @@ class XEP_0384(BasePlugin):
|
|||
raise UntrustedException(exn.bare_jid, exn.device, exn.ik)
|
||||
raise
|
||||
finally:
|
||||
asyncio.ensure_future(self._publish_bundle())
|
||||
asyncio.create_task(self._publish_bundle())
|
||||
|
||||
if self.auto_heartbeat:
|
||||
log.debug('Checking if heartbeat is required. auto_hearbeat enabled.')
|
||||
|
|
Loading…
Reference in a new issue