Long running delayed_job jobs stay locked after a restart on Heroku

后端 未结 6 2232
遥遥无期
遥遥无期 2020-12-01 05:00

When a Heroku worker is restarted (either on command or as the result of a deploy), Heroku sends SIGTERM to the worker process. In the case of delayed_job

6条回答
  •  孤独总比滥情好
    2020-12-01 05:33

    I use a state machine to track the progress of jobs, and make the process idempotent so I can call perform on a given job/object multiple times and be confident it won't re-apply a destructive action. Then update the rake task/delayed_job to release the log on TERM.

    When the process restarts it will continue as intended.

提交回复
热议问题