mirror of
https://github.com/simple-login/app.git
synced 2026-04-07 19:27:34 +00:00
Do not miss remaining tasks
This commit is contained in:
@@ -55,18 +55,18 @@ class EventDispatcher:
|
||||
if dispatcher is None:
|
||||
dispatcher = GlobalDispatcher.get_dispatcher()
|
||||
if config.EVENT_WEBHOOK_DISABLE:
|
||||
LOG.i("Not sending events because webhook is disabled")
|
||||
LOG.d("Not sending events because webhook is disabled")
|
||||
return
|
||||
|
||||
if not config.EVENT_WEBHOOK and skip_if_webhook_missing:
|
||||
LOG.i(
|
||||
LOG.d(
|
||||
"Not sending events because webhook is not configured and allowed to be empty"
|
||||
)
|
||||
return
|
||||
|
||||
partner_user = EventDispatcher.__partner_user(user.id)
|
||||
if not partner_user:
|
||||
LOG.i(f"Not sending events because there's no partner user for user {user}")
|
||||
LOG.d(f"Not sending events because there's no partner user for user {user}")
|
||||
return
|
||||
|
||||
event = event_pb2.Event(
|
||||
|
||||
@@ -1011,6 +1011,8 @@ async def _hibp_process_queue_check(api_key: str, queue: asyncio.Queue):
|
||||
try:
|
||||
alias_id = queue.get_nowait()
|
||||
except asyncio.QueueEmpty:
|
||||
if len(alias_tasks) > 0:
|
||||
await asyncio.gather(*alias_tasks, return_exceptions=True)
|
||||
return
|
||||
|
||||
alias = Alias.get(alias_id)
|
||||
@@ -1021,8 +1023,6 @@ async def _hibp_process_queue_check(api_key: str, queue: asyncio.Queue):
|
||||
if len(alias_tasks) >= config.HIBP_CONCURRENT_TASKS:
|
||||
await asyncio.gather(*alias_tasks, return_exceptions=True)
|
||||
alias_tasks = []
|
||||
if len(alias_tasks) > 0:
|
||||
await asyncio.gather(*alias_tasks, return_exceptions=True)
|
||||
|
||||
|
||||
async def _hibp_check_alias(alias: Alias, api_key: str, retries: int = 0):
|
||||
|
||||
Reference in New Issue
Block a user