So I am working on a project where I want a job to run only if there is not one running with the same worker class. So I monkey patch the Delayed::Job class to have a new method called job_exist?(job).
Delayed::Job.class_eval do
def self.job_exist?(job)
return Delayed::Job.find(:first, :conditions => ["handler like ?", "%" + job.name + "%"])
end
end
Now I can do code that looks like this
Delayed::Job.enqueue LoadImages.new if !Delayed::Job.job_exist?(LoadImages)
I know this is not perfect but for jobs that are considered singletons it works well.

Poor news - Syria's 'mutilation mystery' deepens...
Posted by: Jessica Gutierrez | 12/15/2011 at 12:55 AM
I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
Posted by: moncler jacket | 01/16/2012 at 06:59 AM