Delayed_job - Does the code not update?

I use delayed_job (I tried both tobi and collect_idea) on a hosting on site5.com, with a passenger environment. I managed to get the job done. However, it seems that the plugin ignores any changes to the source code of the job class after the first run. I restarted the server with every change ( touch tmp/restart.txt), but it still ignores it.

Example:

file: lib/xx_job.rb

class XxJob
  def perform
    Rails.logger.info "XX START"

    TempTest.delete_all

    i = 0
    10.times {
      i+=1
      TempTest.create(:name => "XXX")
      sleep(1)
    }

    Rails.logger.info "XX END"
  end
end

In a simple controller, I call:

Delayed::Job.enqueue(XxJob.new)

Conclusions that I have gathered:

  • If I change xx_job.rb to xx_job1.rb - error on the controller
  • If I changed the XxJob class to the XxJob1 class - an error on the controller
  • If I delete the entire contents of the execution method, the old code of the old code is executed
  • New .rb file with class and execute, enqueue this class - works great
  • - , -

. , Passenger - .

? - ? ( , )

!

+3
2

, , . , , .

+2

Source: https://habr.com/ru/post/1726730/


All Articles