我们可以在 RQ 调度程序中检索最初在 scheduler.Schedule()(如 Args)中传递的参数吗?
Can we retrieve the parameters originally passed in scheduler.Schedule() (Like Args) in RQ scheduler?
我想要的:
我正在尝试检索我在 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
对此的回答是“不”,无法完成
任何与作业相关的参数只能使用作业 ID 检索,因此我建议为您的所有作业保留作业 ID,否则您将对它们的原始参数一无所知(当您设置它时)
我想要的:
我正在尝试检索我在 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