SD Ruby,

I'm using delayed_job_active_record 4.0.2 in a Rails 4.1.5 app.  I came 
across some behavior in DJ that I think is a bug but would like other 
opinions.

My app pushes data to two third-party services, so when the related 
ActiveRecord object is deleted data related to the deleted object needs to 
be cleaned up.  This is a perfect task for a background job.

I have a before_destroy callback on the SourceImage object:

before_destroy :destroy_recognition_targets


And the callback looks like this:

Delayed::Job.enqueue RecognitionTargetDestroyerJob.new(src_image) 


The problem I found is that DJ fails when it tries to deserialize the data 
that's serialized as YAML in the job's :handler field (you can see it in 
the database).  Since it can't deserialize the object the job just hangs (I 
would expect an actual error to be thrown, but that's another issue).

There was a Github issue 
<https://github.com/collectiveidea/delayed_job/issues/587> posted about 
this that was closed.  I've added a new one.

Can anyone attest to whether this used to work in DJ?  It seems to me that 
it did, and the linked issue above seems to say the same.  

FYI, the workaround I put in place was to just pass the relevant attributes 
to the DJ job via an OpenStruct, and that works fine.

Cheers,

Chris

-- 
-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
--- 
You received this message because you are subscribed to the Google Groups "SD 
Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to