Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I had face issue of worker process being killed so I have handled it in my application and feel like committing hence commiting same #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/delayed/job.rb
Expand Up @@ -214,7 +214,7 @@ def self.work_off(num = 100)


# Moved into its own method so that new_relic can trace it. # Moved into its own method so that new_relic can trace it.
def invoke_job def invoke_job
payload_object.perform payload_object.perform if payload_object
end end


private private
Expand All @@ -227,13 +227,13 @@ def deserialize(source)
handler_class = $1 handler_class = $1
end end
attempt_to_load(handler_class || handler.class) attempt_to_load(handler_class || handler.class)
handler = YAML.load(source) handler = YAML.load(source) rescue nil
end end


return handler if handler.respond_to?(:perform) return handler if handler.respond_to?(:perform)


raise DeserializationError, raise DeserializationError,
'Job failed to load: Unknown handler. Try to manually require the appropiate file.' 'Job failed to load: Unknown handler. Try to manually require the appropiate file.' if handler
rescue TypeError, LoadError, NameError => e rescue TypeError, LoadError, NameError => e
raise DeserializationError, raise DeserializationError,
"Job failed to load: #{e.message}. Try to manually require the required file." "Job failed to load: #{e.message}. Try to manually require the required file."
Expand Down