문제

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