You may try this:
task :my_task, [:arg1, :arg2] => :environment do |t, args|
puts "Args were: #{args}"
end
and then run manually to see the output:
heroku run rake my_task
UPDATE:
this answer can be an old one already
質問
Rake tasks scheduled in Heroku found online are in the "rake task-name
" format. Heroku passes in an :environment argument to the rake task, but there is no documentation about extra args being passed to a task listed in scheduler.rake
解決
You may try this:
task :my_task, [:arg1, :arg2] => :environment do |t, args|
puts "Args were: #{args}"
end
and then run manually to see the output:
heroku run rake my_task
UPDATE:
this answer can be an old one already
他のヒント
Instead of rake task_name
input rake task_name[arg1, arg2]
to the string input accepted by the Task column in the Heroku Scheduler main screen.
As mentioned by CodeGroover, your rake task defined in lib/scheduler.rake
should define the parameters it is expecting.