ruby on rails - delayed_job and paperclip - Images aren't processed, but no error? -


i'm having big issues trying delayed_job working amazon s3 , paperclip. there few posts around how it, whatever reason it's not working me. i've removed couple of things how others doing - had save(validations => false) in regenerate_styles, seemed cause infinite loop (due after save catch), , didn't seem necessary (since urls have been saved, images not uploaded). here's relevant code model file, submission.rb:

class submission < activerecord::base   has_attached_file :photo ...    ...    before_photo_post_process |submission|     if photo_changed?       false     end   end    after_save |submission|     if submission.photo_changed?       delayed::job.enqueue imagejob.new(submission.id)     end   end    def regenerate_styles!     puts "processing photo"     self.photo.reprocess!   end    def photo_changed?     self.photo_file_size_changed? ||     self.photo_file_name_changed? ||     self.photo_content_type_changed? ||     self.photo_updated_at_changed?   end end 

and little imagejob class sites @ bottom of submission.rb file:

class imagejob < struct.new(:submission_id)   def perform     submission.find(self.submission_id).regenerate_styles!   end end 

as far can tell, job gets created correctly (as i'm able pull out of database via query).

the problem arises when:

$ rake jobs:work warning: nokogiri built against libxml version 2.7.8, has dynamically loaded 2.7.3 [worker(host:jarrod-robins-macbook.local pid:21738)] new relic ruby agent monitoring dj worker host:macbook.local pid:21738 [worker(host:macbook.local pid:21738)] starting job worker processing photo [worker(host:macbook.local pid:21738)] imagejob completed after 9.5223 [worker(host:macbook.local pid:21738)] 1 jobs processed @ 0.1045 j/s, 0 failed ... 

the rake task gets stuck , never exits, , images don't appear have been reprocessed.

any ideas?

edit: point; same thing happens on heroku, not locally.

delayed job capturing stack trace failed jobs. it’s saved in last_error column of delayed_jobs table. use database gui see whats going on.

if should using collective ideas fork activerecord backend can query model usual. fetch array of stack traces example do

delayed::job.where('failed_at not null').map(&:last_error) 

by default failed jobs deleted after 25 failed attempts. may there no jobs anymore. prevent deletion debugging purposes setting

delayed::worker.destroy_failed_jobs = false 

in config/initializers/delayed_job_config.rb


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -

delphi - How to convert bitmaps to video? -