Celery存储不可恢复的任务故障以供以后重新提交 [英] Celery Storing unrecoverable task failures for later resubmission

查看:104
本文介绍了Celery存储不可恢复的任务故障以供以后重新提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用djkombu运输工具进行本地开发,但是我可能会在生产中使用amqp(兔子)。

I'm using the djkombu transport for my local development, but I will probably be using amqp (rabbit) in production.

我希望能够遍历特定类型的故障并重新提交。这可能是由于服务器出现故障或由于某些新的数据变化而触发的边缘案例错误。

I'd like to be able to iterate over failures of a particular type and resubmit. This would be in the case of something failing on a server or some edge case bug triggered by some new variation in data.

所以我可以重新提交最多12个小时的作业

So I could be resubmitting jobs up to 12 hours later after some bug is fixed or a third party site is back up.

我的问题是:是否有一种方法可以通过结果后端访问旧的失败作业,然后简单地重新提交

My question is: Is there a way to access old failed jobs via the result backend and simply resubmit them with the same params etc?

推荐答案

来自IRC


< asksol> dpn`:任务args和kwargs不与结果一起存储

<asksol> dpn`: task args and kwargs are not stored with the result

< asksol> dpn`:但是您可以创建自己的模型并将其存储在其中
(例如,使用task_sent信号)

<asksol> dpn`: but you can create your own model and store it there (for example using the task_sent signal)

< asksol>发送任务时,我们什么也不存储,只发送一条
消息。但这很容易做

<asksol> we don't store anything when the task is sent, only send a message. but it's very easy to do yourself

这是我的期望,但希望避免。

This was what I was expecting, but hoped to avoid.

至少我现在有一个答案:)

At least I have an answer now :)

这篇关于Celery存储不可恢复的任务故障以供以后重新提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆