I already know that running a rake task from .rb file can be done by running:
system "/usr/bin/rake #{task} #{args.join(' ')} > #{Rails.root}/log/rake.log"
But how to stop a currently running rake task from ruby file?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Perhaps you could do a
then, parse the pid. then, issue a kill command
I haven’t tried this yet though.