def queue_page(model_import, job_import, worker_count, offset):
"""
Spool a page of model instances for a job.
Args:
model_import (str)
job_import (str)
worker_count (int)
offset (int)
"""
# Import callables.
model = locate(model_import)
job = locate(job_import)
for row in model.page_cursor(worker_count, offset):
config.rq.enqueue(job, row.id)
评论列表
文章目录