use a follower for one of the repos endpoint

This commit is contained in:
Josh Kalderimis 2013-05-02 16:38:20 +02:00
parent f9a1dc9bf3
commit fa6ea0692d
4 changed files with 20 additions and 1 deletions

View File

@ -23,6 +23,8 @@ gem 'dalli'
gem 'pry'
gem 'metriks', '0.9.9.2'
gem 'ar-octopus', github: 'tchandy/octopus', require: 'octopus'
group :test do
gem 'rspec', '~> 2.11'
gem 'factory_girl', '~> 2.4.0'

View File

@ -43,6 +43,14 @@ GIT
activesupport
hashr (~> 0.0.10)
GIT
remote: git://github.com/tchandy/octopus.git
revision: 8df2768bf37e75e6cc30816eeb9440748a2a3ae9
specs:
ar-octopus (0.5.0beta)
activerecord (>= 2.3.0)
activesupport (>= 2.3.0)
GIT
remote: git://github.com/travis-ci/travis-core.git
revision: 75986691f25bd5533fa812dbe81638c7d1da3651
@ -274,6 +282,7 @@ PLATFORMS
ruby
DEPENDENCIES
ar-octopus!
bunny
dalli
database_cleaner (~> 0.8.0)

View File

@ -118,6 +118,12 @@ module Travis::Api
def self.setup_travis
Travis::Amqp.config = Travis.config.amqp
Travis::Database.connect
Octopus.setup do |config|
config.shards = { :follower => Travis.config.database_follower }
config.environments = [:production]
end
Travis::Features.start
if Travis.env == 'production' || Travis.env == 'staging'

View File

@ -52,7 +52,9 @@ class Travis::Api::App
#
# json(:repository)
get '/:owner_name/:name' do
respond_with service(:find_repo, params)
Octopus.using(:follower) do
respond_with service(:find_repo, params)
end
end
# Gets the builds for the repository with the given name.