Search code examples
ruby-on-railsherokusphinxthinking-sphinx

Flying-sphinx and Heroku scheduler


Because I'm a newbie at FS, Heroku and Rails I am having trouble implementing the scheduler rake task.

I build a scheduler.rake in my lib/tasks folder and set up the following:

desc "This task is called by the Heroku scheduler add-on"
task :index_sphinx => :environment do
  puts "Indexing Sphinx db..."
 ???flying-sphinx index???
  puts "done."
end

As you can see we have a problem because I have no idea how to type the flying-sphinx index command in the task - what format the command is supposed to take.

The Heroku FS doco states to "just add flying-sphinx index as the task" but this doesn't tel me exactly how to type it down - it probably requires a little background knowledge I still don't have.


Solution

  • I found the solution 0 though I understand from Pat (the founder of FS) there is a simpler one.

    First, mine:

    system 'flying-sphinx index'
    

    And his:simply type:

    bundle exec flying-sphinx index
    

    in the scheduler dashboard.

    Hope this has been useful to someone.