0

我想要的是:

我正在尝试在调度时检索我在 rq 调度程序中传递给我的作业的参数,例如:传递的参数、函数名称和其他内容

我已经尝试过的:

list_of_jobs=scheduler.get_jobs()
# print("jobs lsit",list_of_jobs)

for job in list_of_jobs:
    print(job.args)

显示错误

Traceback (most recent call last):
 
 
    raise AppRegistryNotReady("Models aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  ile "/home/munz/.local/lib/python3.7/site-packages/rq/job.py", line 266, in _deserialize_data
    raise DeserializationError() from e
rq.exceptions.DeserializationError
4

1 回答 1

0

对此的回答是否定的,它不能完成

任何与作业相关的参数只能使用作业 ID 检索,因此我建议为所有作业保留作业 ID,否则您将对其原始参数一无所知(设置时)

于 2022-01-28T14:51:07.023 回答