corroded
corroded

Reputation: 21564

How do you set the Redis url in Resque if you're not using Rails?

In rails, it is easy to just add a config/resque.yml, but we're running a gem on the command line and we would like to tell it where to look for Resque jobs instead of the default localhost:6379

Right now, we run our gem by going to the gem lib and then running rake resque:work etc etc.. so how do we tell it where redis is?(redis could be in another machine in the network or in the cloud)

Upvotes: 1

Views: 1346

Answers (2)

richardkmiller
richardkmiller

Reputation: 3022

Building on corroded's answer, I had to do this:

require "./my_class"
require "resque"
Resque.redis = 'server:port'
require "resque/tasks"

Upvotes: 1

corroded
corroded

Reputation: 21564

We fixed this by just adding Resque.redis = 'server:port in our gem's Rakefile, just before we included resque via require 'resque/tasks'

Upvotes: 0

Related Questions