feat(core): Add queue_name parameter to enqueue() function

Added the queue_name parameter to the enqueue() function to specify the target queue name for task scheduling. If this parameter is not provided, the system will default to using the predefined model queue. This enhancement provides greater scheduling flexibility, allowing tasks to be assigned to different queues as needed.
This commit is contained in:
dianbofa 2025-05-08 13:25:51 +08:00
parent 23d1213c9c
commit 4d6648854d

View File

@ -227,6 +227,8 @@ class Job(models.Model):
interval: Recurrence interval (in minutes)
immediate: Run the job immediately without scheduling it in the background. Should be used for interactive
management commands only.
queue_name: Specifies a target queue name for task scheduling. If omitted,
the system defaults to the predefined model queue.(optional)
"""
if schedule_at and immediate:
raise ValueError(_("enqueue() cannot be called with values for both schedule_at and immediate."))