I have a periodic task that needs to be done once a minute (using delayed_job). I would like Rails to automatically queue as soon as it finishes loading, if one such task is not already present on the system.
What suits me to run the code at the end of the entire Rails bootstrap? Someone suggested config / environment / development.rb (or another environment), but delayed_job gives me ActiveRecord problems when I queue jobs from there.
I consulted http://guides.rubyonrails.org/initialization.html and there seems to be no clear place for such code.
Is such a deployment possible after deployment, perhaps externally for my application code, perhaps using rake or other methods? Any suggestions?
Thanks!
ruby-on-rails ruby-on-rails-3 delayed-job
Alexandr Kurilin
source share