我正在尝试使用resque为后台工作写一个工人

时间:2015-12-22 11:49:31

标签: python ruby-on-rails backgroundworker resque

你好我是rails的新手我想在我的rails应用程序中创建一个worker,使用resque作为后台作业。 工作者必​​须运行位于我的主目录中的python脚本。

class DataCollector
  @queue = :data_collection_queue

  def self.perform(*args)
    redis = Redis.new(:host => Figaro.env.redis_host, :port => Figaro.env.redis_port, :password => Figaro.env.redis_password)
      system("exec '/usr/home/hello.py'")
  end
end

任何建议?

0 个答案:

没有答案