fix: specify default dispatcher in job runner (#2191)

This commit is contained in:
Carlos Quintana 2024-08-23 09:11:47 +02:00 committed by GitHub
parent 57991f4d6b
commit 737c561227
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,6 +14,7 @@ from app.email_utils import (
send_email, send_email,
render, render,
) )
from app.events.event_dispatcher import PostgresDispatcher
from app.import_utils import handle_batch_import from app.import_utils import handle_batch_import
from app.jobs.event_jobs import send_alias_creation_events_for_user from app.jobs.event_jobs import send_alias_creation_events_for_user
from app.jobs.export_user_data_job import ExportUserDataJob from app.jobs.export_user_data_job import ExportUserDataJob
@ -276,7 +277,9 @@ SimpleLogin team.
user = User.get(user_id) user = User.get(user_id)
if user and user.activated: if user and user.activated:
LOG.d(f"Sending alias creation events for {user}") LOG.d(f"Sending alias creation events for {user}")
send_alias_creation_events_for_user(user) send_alias_creation_events_for_user(
user, dispatcher=PostgresDispatcher.get()
)
else: else:
LOG.e("Unknown job name %s", job.name) LOG.e("Unknown job name %s", job.name)