use a follower for one of the repos endpoint
This commit is contained in:
parent
f9a1dc9bf3
commit
fa6ea0692d
2
Gemfile
2
Gemfile
|
@ -23,6 +23,8 @@ gem 'dalli'
|
||||||
gem 'pry'
|
gem 'pry'
|
||||||
gem 'metriks', '0.9.9.2'
|
gem 'metriks', '0.9.9.2'
|
||||||
|
|
||||||
|
gem 'ar-octopus', github: 'tchandy/octopus', require: 'octopus'
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem 'rspec', '~> 2.11'
|
gem 'rspec', '~> 2.11'
|
||||||
gem 'factory_girl', '~> 2.4.0'
|
gem 'factory_girl', '~> 2.4.0'
|
||||||
|
|
|
@ -43,6 +43,14 @@ GIT
|
||||||
activesupport
|
activesupport
|
||||||
hashr (~> 0.0.10)
|
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
|
GIT
|
||||||
remote: git://github.com/travis-ci/travis-core.git
|
remote: git://github.com/travis-ci/travis-core.git
|
||||||
revision: 75986691f25bd5533fa812dbe81638c7d1da3651
|
revision: 75986691f25bd5533fa812dbe81638c7d1da3651
|
||||||
|
@ -274,6 +282,7 @@ PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
ar-octopus!
|
||||||
bunny
|
bunny
|
||||||
dalli
|
dalli
|
||||||
database_cleaner (~> 0.8.0)
|
database_cleaner (~> 0.8.0)
|
||||||
|
|
|
@ -118,6 +118,12 @@ module Travis::Api
|
||||||
def self.setup_travis
|
def self.setup_travis
|
||||||
Travis::Amqp.config = Travis.config.amqp
|
Travis::Amqp.config = Travis.config.amqp
|
||||||
Travis::Database.connect
|
Travis::Database.connect
|
||||||
|
|
||||||
|
Octopus.setup do |config|
|
||||||
|
config.shards = { :follower => Travis.config.database_follower }
|
||||||
|
config.environments = [:production]
|
||||||
|
end
|
||||||
|
|
||||||
Travis::Features.start
|
Travis::Features.start
|
||||||
|
|
||||||
if Travis.env == 'production' || Travis.env == 'staging'
|
if Travis.env == 'production' || Travis.env == 'staging'
|
||||||
|
|
|
@ -52,8 +52,10 @@ class Travis::Api::App
|
||||||
#
|
#
|
||||||
# json(:repository)
|
# json(:repository)
|
||||||
get '/:owner_name/:name' do
|
get '/:owner_name/:name' do
|
||||||
|
Octopus.using(:follower) do
|
||||||
respond_with service(:find_repo, params)
|
respond_with service(:find_repo, params)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Gets the builds for the repository with the given name.
|
# Gets the builds for the repository with the given name.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue
Block a user