在Delayed_job中手动重试作业 [英] Manually Retry Job in Delayed_job

查看:98
本文介绍了在Delayed_job中手动重试作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Delayed :: Job的自动重试功能非常好,但我现在想要手动重试。有没有一种方法可以在工作上自动调用......

  Delayed :: Job.all [0] .perform 

或运行,或者其他。我尝试了几件事情,并梳理了文档,但无法弄清楚如何执行手动重试作业。 解决方案

p>手工调用工作

  Delayed :: Job.find(10).invoke_job#10是job.id 

如果成功运行,则不会删除作业。您需要手动删除它:

  Delayed :: Job.find(10).destroy 


Delayed::Job's auto-retry feature is great, but there's a job that I want to manually retry now. Is there a method I can call on the job itself like...

Delayed::Job.all[0].perform

or run, or something. I tried a few things, and combed the documentation, but couldn't figure out how to execute a manual retry of a job.

解决方案

To manually call a job

Delayed::Job.find(10).invoke_job # 10 is the job.id

This does not remove the job if it is run successfully. You need to remove it manually:

Delayed::Job.find(10).destroy

这篇关于在Delayed_job中手动重试作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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