diff options
author | Marius Mathiesen <marius@gitorious.org> | 2012-11-29 13:04:32 (GMT) |
---|---|---|
committer | Marius Mathiesen <marius@gitorious.org> | 2012-11-29 13:04:32 (GMT) |
commit | aeeeec5bc567e41ae7ea6c660cd8d6669da215d0 (patch) | |
tree | 1d9db8f0664978b368066afdf76e98586f7884b5 | |
parent | b50c6c39742195bf9329df25c2540f2435f7071e (diff) |
Support a remote redis server when sending messages on push
Since .hooks/messaging doesn't spawn a full Rails environment,
config/resque.yml is not read and a local Redis connection is assumed.
-rw-r--r-- | data/hooks/messaging.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/data/hooks/messaging.rb b/data/hooks/messaging.rb index 8077ee6..b4b3491 100644 --- a/data/hooks/messaging.rb +++ b/data/hooks/messaging.rb @@ -53,6 +53,13 @@ if !defined?(GitoriousConfig) Bundler.require adapter.to_sym Gitorious::Messaging.load_adapter(adapter) Gitorious::Messaging.configure_publisher(adapter) + if adapter == "resque" + resque_config = Rails.root + "config/resque.yml" + if resque_config.exist? + settings = YAML::load_file(resque_config)[Rails.env.to_s] + Resque.redis = settings if settings + end + end end class Publisher |