BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
69dfeeb8
Commit
69dfeeb8
authored
Mar 17, 2017
by
Rémy Coutable
Committed by
DJ Mountney
Mar 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'database-config-method' into 'master'
Added Gitlab::Database.config See merge request !10045
parent
a8e94e24
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
sidekiq.rb
config/initializers/sidekiq.rb
+1
-1
database.rb
lib/gitlab/database.rb
+5
-1
database_spec.rb
spec/lib/gitlab/database_spec.rb
+10
-4
No files found.
config/initializers/sidekiq.rb
View file @
69dfeeb8
...
...
@@ -42,7 +42,7 @@ Sidekiq.configure_server do |config|
Gitlab
::
SidekiqThrottler
.
execute!
config
=
ActiveRecord
::
Base
.
configurations
[
Rails
.
env
]
||
config
=
Gitlab
::
Database
.
config
||
Rails
.
application
.
config
.
database_configuration
[
Rails
.
env
]
config
[
'pool'
]
=
Sidekiq
.
options
[
:concurrency
]
ActiveRecord
::
Base
.
establish_connection
(
config
)
...
...
lib/gitlab/database.rb
View file @
69dfeeb8
...
...
@@ -5,8 +5,12 @@ module Gitlab
# http://dev.mysql.com/doc/refman/5.7/en/integer-types.html
MAX_INT_VALUE
=
2147483647
def
self
.
config
ActiveRecord
::
Base
.
configurations
[
Rails
.
env
]
end
def
self
.
adapter_name
ActiveRecord
::
Base
.
configurations
[
Rails
.
env
]
[
'adapter'
]
config
[
'adapter'
]
end
def
self
.
mysql?
...
...
spec/lib/gitlab/database_spec.rb
View file @
69dfeeb8
require
'spec_helper'
class
MigrationTest
include
Gitlab
::
Database
end
describe
Gitlab
::
Database
,
lib:
true
do
before
do
stub_const
(
'MigrationTest'
,
Class
.
new
{
include
Gitlab
::
Database
})
end
describe
'.config'
do
it
'returns a Hash'
do
expect
(
described_class
.
config
).
to
be_an_instance_of
(
Hash
)
end
end
describe
'.adapter_name'
do
it
'returns the name of the adapter'
do
expect
(
described_class
.
adapter_name
).
to
be_an_instance_of
(
String
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment