Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
a037a791
Commit
a037a791
authored
Aug 17, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup repositories settings properly
parent
1c3a2bc3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+5
-1
spec/initializers/settings_spec.rb
spec/initializers/settings_spec.rb
+9
-0
No files found.
config/initializers/1_settings.rb
View file @
a037a791
...
...
@@ -440,7 +440,9 @@ unless Settings.repositories.storages['default']
Settings
.
repositories
.
storages
[
'default'
][
'path'
]
||=
Settings
.
gitlab
[
'user_home'
]
+
'/repositories/'
end
Settings
.
repositories
.
storages
.
values
.
each
do
|
storage
|
Settings
.
repositories
.
storages
.
each
do
|
key
,
storage
|
storage
=
Settingslogic
.
new
(
storage
)
# Expand relative paths
storage
[
'path'
]
=
Settings
.
absolute
(
storage
[
'path'
])
# Set failure defaults
...
...
@@ -454,6 +456,8 @@ Settings.repositories.storages.values.each do |storage|
storage
[
'failure_reset_time'
]
=
storage
[
'failure_reset_time'
].
to_i
# We might want to have a timeout shorter than 1 second.
storage
[
'storage_timeout'
]
=
storage
[
'storage_timeout'
].
to_f
Settings
.
repositories
.
storages
[
key
]
=
storage
end
#
...
...
spec/initializers/settings_spec.rb
View file @
a037a791
...
...
@@ -27,6 +27,15 @@ describe Settings do
expect
(
repository_settings
[
'failure_reset_time'
]).
to
eq
(
1800
)
expect
(
repository_settings
[
'storage_timeout'
]).
to
eq
(
5
)
end
it
'can be accessed with dot syntax all the way down'
do
expect
(
Gitlab
.
config
.
repositories
.
storages
.
broken
.
failure_count_threshold
).
to
eq
(
10
)
end
it
'can be accessed in a very specific way that breaks without reassigning each element with Settingslogic'
do
storage_settings
=
Gitlab
.
config
.
repositories
.
storages
[
'broken'
]
expect
(
storage_settings
.
failure_count_threshold
).
to
eq
(
10
)
end
end
describe
'#host_without_www'
do
...
...
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