【问题标题】:Flying-sphinx and Heroku schedulerFlying-sphinx 和 Heroku 调度程序
【发布时间】:2013-04-07 21:24:04
【问题描述】:

因为我是 FS、Heroku 和 Rails 的新手,所以我在实现调度程序 rake 任务时遇到了麻烦。

我在我的 lib/tasks 文件夹中构建了一个 scheduler.rake 并设置了以下内容:

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

如您所见,我们遇到了问题,因为我不知道如何在任务中键入 fly-sphinx index 命令 - 该命令应该采用什么格式。

Heroku FS doco 声明“只需添加 fly-sphinx 索引作为任务”,但这并没有告诉我确切的输入方法 - 它可能需要一些我仍然没有的背景知识。

【问题讨论】:

    标签: ruby-on-rails heroku sphinx thinking-sphinx


    【解决方案1】:

    我找到了解决方案 0,虽然我从 Pat(FS 的创始人)那里了解到有一个更简单的解决方案。

    首先,我的:

    system 'flying-sphinx index'
    

    而他的:只需输入:

    bundle exec flying-sphinx index
    

    在调度程序仪表板中。

    希望这对某人有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-11-15
      • 2014-04-14
      • 2013-03-14
      • 1970-01-01
      • 2017-04-03
      • 2017-07-19
      • 1970-01-01
      相关资源
      最近更新 更多