0
def process_order
  OrderProcess.delay(run_at:1.minutes.from_now).processing_order(params[:id])
    redirect_to '/'
end

when process_order is executed it will execute delayed job

class OrderProcess
  def self.processing_order(order_id)
    system("rails generate controller welcome index")
  end
end

when we remove delay(run_at:1.minutes.from_now) and process_order then rails commands in system command are getting executed but when we run through delayed job rails commands are not getting executed

thanks in advance

naveenmora
  • 61
  • 6
  • This might help you http://stackoverflow.com/questions/27582269/delayed-job-how-to-set-delayrun-at-from-attribute-time-from-now – Monsieur Slim Jun 18 '15 at 15:30
  • Thanks for the response @MonsieurSlim, i am trying to run rails commands in delayed job and i am able to run rake commands. – naveenmora Jun 19 '15 at 06:15
  • This should help: http://stackoverflow.com/questions/13358805/rails-execute-script-as-background-job – Daiku Jun 30 '15 at 16:04

0 Answers0