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

Heroku Scheduler Doc

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top