Skip to content
Snippets Groups Projects
Unverified Commit bed3529a authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

scheduler/runner-first-visits: Log number of first visits scheduled

parent 72f72130
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ def schedule_first_visits(backend: SchedulerInterface):
f"{lister.first_visits_queue_prefix}:{task_type.backend_name}"
)
send_to_celery(
nb_first_visits = send_to_celery(
backend,
visit_type_to_queue=visit_type_to_queue,
policy="first_visits_after_listing",
......@@ -84,3 +84,5 @@ def schedule_first_visits(backend: SchedulerInterface):
)
lister.first_visits_scheduled_at = utcnow()
backend.update_lister(lister)
return nb_first_visits
......@@ -248,9 +248,10 @@ def runner_first_visits(ctx, period):
try:
while True:
logger.debug("Schedule first visits")
logger.debug("Schedule first visits...")
try:
schedule_first_visits(scheduler)
nb_first_visits = schedule_first_visits(scheduler)
logger.info("Scheduled %s first visits", nb_first_visits)
except ValueError:
logger.exception("Unexpected error in run_high_priority_first_visits()")
sentry_sdk.capture_exception()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment