Skip to content

Instantly share code, notes, and snippets.

@eccyan
Last active August 29, 2015 13:57
Show Gist options
  • Save eccyan/9755592 to your computer and use it in GitHub Desktop.
Save eccyan/9755592 to your computer and use it in GitHub Desktop.
Resque の Worker 毎に Redis のホストを設定する ref: http://qiita.com/eccyan/items/c10b4b0080c235b65976
require 'worker_base'
class Worker < WorkerBase
@redis = OTHER_REDIS_HOST
# ...
end
class WorkerBase
def self.before_enqueue(*args)
Resque.redis = @redis if @redis
end
def self.after_enqueue(*args)
Resque.redis = DEFAULT_REDIS_HOST
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment