Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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 from

1 participant

@anilg

handled issue of worker process being killed while creating handler and loading yaml for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 11, 2011
  1. @anilg
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/delayed/job.rb
View
6 lib/delayed/job.rb
@@ -214,7 +214,7 @@ def self.work_off(num = 100)
# Moved into its own method so that new_relic can trace it.
def invoke_job
- payload_object.perform
+ payload_object.perform if payload_object
end
private
@@ -227,13 +227,13 @@ def deserialize(source)
handler_class = $1
end
attempt_to_load(handler_class || handler.class)
- handler = YAML.load(source)
+ handler = YAML.load(source) rescue nil
end
return handler if handler.respond_to?(:perform)
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
raise DeserializationError,
"Job failed to load: #{e.message}. Try to manually require the required file."
Something went wrong with that request. Please try again.