在我的应用程序中,延迟的作业不再在我的服务器上自动运行。曾经..
当我手动 ssh 并执行 rake 作业时:work
我返回这个:
*** Starting job worker host:ip-(censored) pid:21458
* [Worker(host:ip-(censored) pid:21458)] acquired lock on PhotoJob
* [JOB] host:ip-(censored) pid:21458 failed with ActiveRecord::RecordNotFound: Couldn't find Photo with ID=9237 - 4 failed attempts
对于我认为是几份工作的情况,这大约会返回 20 倍。然后我得到其中一些:
* [Worker(host:ip-(censored) pid:21458)] failed to acquire exclusive lock for PhotoJob
最后是其中之一:
12 jobs processed at 73.6807 j/s, 12 failed ...
有什么我应该考虑的想法吗?非常感谢!
编辑 :
这是调用延迟作业的照片控制器:
def update
@gallery = @organization.media.find_by_media_id(params[:gallery_id]).media
@photo = @gallery.photos.find(params[:id])
if @photo.update_attributes(params[:photo])
@photo.update_attribute(:processing, true)
logger.info "HERE IS PROCESSING #{@photo.processing}"
Delayed::Job.enqueue PhotoJob.new(@photo.id)
respond_to do |format|
format.html do
if params[:captions_screen] == 'true'
logger.info "WE ARE GOING TO DO NOTHING AT ALL"
render :text => ''
else
redirect_to organization_media_url(@organization)
end
end
format.js { redirect_to organization_media_url(@organization) }
end
else
render :action => 'edit'
end
end