Skip to content

Commit

Permalink
fix kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Kuo (Danswer) committed Jan 22, 2025
1 parent 5608553 commit f57fd0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/onyx/background/celery/apps/beat.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _generate_schedule(
cloud_task = {
"task": task["task"],
"schedule": task["schedule"],
"kwargs": {},
"kwargs": task.get("kwargs", {}),
}
if options := task.get("options"):
logger.debug(f"Adding options to task {task_name}: {options}")
Expand Down
7 changes: 4 additions & 3 deletions backend/onyx/background/celery/tasks/shared/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def document_by_cc_pair_cleanup_task(
@shared_task(
name=OnyxCeleryTask.CLOUD_BEAT_TASK_GENERATOR,
trail=False,
bind=True,
)
def cloud_beat_task_generator(
self: Task,
Expand Down Expand Up @@ -259,19 +260,19 @@ def cloud_beat_task_generator(
"Soft time limit exceeded, task is being terminated gracefully."
)
except Exception:
task_logger.exception("Unexpected exception during cloud_generate_beat_tasks")
task_logger.exception("Unexpected exception during cloud_beat_task_generator")
finally:
if not lock_beat.owned():
task_logger.error(
"cloud_generate_beat_tasks - Lock not owned on completion"
"cloud_beat_task_generator - Lock not owned on completion"
)
redis_lock_dump(lock_beat, redis_client)
else:
lock_beat.release()

time_elapsed = time.monotonic() - time_start
task_logger.info(
f"cloud_generate_beat_tasks finished: "
f"cloud_beat_task_generator finished: "
f"task={task_name} "
f"num_tenants={len(tenant_ids)} "
f"elapsed={time_elapsed:.2f}"
Expand Down

0 comments on commit f57fd0d

Please sign in to comment.