Closed kurbmedia closed 14 years ago
There are a few columns that need to be added to the delayed_jobs table. I haven't created a generator yet, that's on my list to do before going 1.0. This is what my migration looks like for the DJ table:
https://gist.github.com/700872
DJ Remixes let's you use DJ outside of it, but if you want the full power of it then you have to subclass DJ::Worker. Emails, on the other hand are being handled always by DJ Remixes. I might change that by 1.0, but I, personally, like ALL my emails to be handled by DJ, and I didn't want to have to change any of the .deliver calls in my code to do that, that's why the worker's work that way. Again, that might change in 1.0, probably a configuration setting or something.
Does that answer your questions?
Wow, thanks for that quick response. Yep sure does. I was pretty sure I knew what was going on, but wanted to confirm to make sure.
I'll try creating a fork and adding a generator. If you are thinking of making emails a config setting I'll look into that too. What you are saying make sense, but on the other side of things I wouldn't want to have to change all of my .deliver calls to use DJ just to get the extras :) DelayedJob works great in what we have setup, but I was looking into remixes for things like a billing job and daily newsletters. For those I was using DJ::Worker.
I changed the title in case someone else comes across this.
Thanks again!
I am using remixes with the current master branch of DJ (though was using the most recent release > 2.1 but trying to fix the issues). When sending mail I keep getting a undefined method "worker_class_name=" for Delayed::Backend::ActiveRecord.
I am using normal DelayedJob for one off emails but was setting up remixes to handle recurring email jobs and a few other tasks. When DelayedJob fails to run its task, the actual error logged is that I am missing the "started_at" column in my delayed_jobs table. I couldn't find any sort of migration in remixes or DJ that added this field, so I'm not sure if thats really the issue, or if that is what DelayedJob is assuming it is.
One question I have is are you able to continue to use DelayedJob normally once adding Remixes? It seems like remixes is overriding everything. My email jobs are actually being created using the remixes MailManWorker (as identified by the handler in my DJ table) leading me to believe DJ is being skipped completely and MailManWorker is taking over the job.
That being said the entire problem could be that I need to be using an official "Job" (subclassing DJ::Worker), but it seemed to me that Remixes was more of an addon where I could still use DJ as normal outside of it.
Any thoughts or ideas? Thanks!