delayed_job daemon quitting on errors
I'm running the delayed_job daemon using daemon-spawn gem, however, whenever there is a database locked error or any other type of error for that matter, the delayed_job daemon stops/quits. Is there any way to rescue these exceptions in the dae开发者_运维问答mon?
I suppose it's no code, no answer :)
Depending on your setup you can rescue errors:
class CrawlJob
attr_accessor :site_id
def initialize(site_id)
self.site_id = site_id
end
def perform
begin
Site.find(self.site_id).crawl
rescue
# ... handle the error
end
end
end
精彩评论