plugin identity: add a timeout when getting identities.
This commit is contained in:
parent
4a0d106b90
commit
331e7dc5c4
1 changed files with 6 additions and 3 deletions
|
|
@ -20,9 +20,10 @@ import io
|
|||
from pathlib import Path
|
||||
from base64 import b64encode
|
||||
import hashlib
|
||||
from typing import Any, Coroutine, Dict, List, Optional, Union
|
||||
from typing import Any, Coroutine, Dict, List, Optional, Union, cast
|
||||
|
||||
from twisted.internet import defer, threads
|
||||
from twisted.internet import defer, reactor, threads
|
||||
from twisted.internet.interfaces import IReactorCore
|
||||
from twisted.words.protocols.jabber import jid
|
||||
|
||||
from libervia.backend.core import exceptions
|
||||
|
|
@ -790,7 +791,9 @@ class Identity:
|
|||
)
|
||||
)
|
||||
)
|
||||
identities_result = await defer.DeferredList(get_identity_list)
|
||||
deferred_list = defer.DeferredList(get_identity_list)
|
||||
deferred_list.addTimeout(5, cast(IReactorCore, reactor))
|
||||
identities_result = await deferred_list
|
||||
for idx, (success, identity) in enumerate(identities_result):
|
||||
entity_jid = entities[idx]
|
||||
if not success:
|
||||
|
|
|
|||
Loading…
Reference in a new issue