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
Kazuhiko Shiozaki
gitlab-ce
Commits
dc22419c
Commit
dc22419c
authored
Aug 29, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'redis/cache_settings' into 'master'
Move cache setup to config/application.rb See merge request !1050
parents
ad98c8c9
185e7681
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
20 deletions
+19
-20
config/application.rb
config/application.rb
+19
-0
config/initializers/7_cache_settings.rb
config/initializers/7_cache_settings.rb
+0
-20
No files found.
config/application.rb
View file @
dc22419c
...
@@ -73,5 +73,24 @@ module Gitlab
...
@@ -73,5 +73,24 @@ module Gitlab
resource
'/api/*'
,
headers: :any
,
methods:
[
:get
,
:post
,
:options
,
:put
,
:delete
]
resource
'/api/*'
,
headers: :any
,
methods:
[
:get
,
:post
,
:options
,
:put
,
:delete
]
end
end
end
end
# Use Redis caching across all environments
redis_config_file
=
Rails
.
root
.
join
(
'config'
,
'resque.yml'
)
redis_url_string
=
if
File
.
exists?
(
redis_config_file
)
YAML
.
load_file
(
redis_config_file
)[
Rails
.
env
]
else
"redis://localhost:6379"
end
# Redis::Store does not handle Unix sockets well, so let's do it for them
redis_config_hash
=
Redis
::
Store
::
Factory
.
extract_host_options_from_uri
(
redis_url_string
)
redis_uri
=
URI
.
parse
(
redis_url_string
)
if
redis_uri
.
scheme
==
'unix'
redis_config_hash
[
:path
]
=
redis_uri
.
path
end
redis_config_hash
[
:namespace
]
=
'cache:gitlab'
config
.
cache_store
=
:redis_store
,
redis_config_hash
end
end
end
end
config/initializers/7_cache_settings.rb
deleted
100644 → 0
View file @
ad98c8c9
Gitlab
::
Application
.
configure
do
redis_config_file
=
Rails
.
root
.
join
(
'config'
,
'resque.yml'
)
redis_url_string
=
if
File
.
exists?
(
redis_config_file
)
YAML
.
load_file
(
redis_config_file
)[
Rails
.
env
]
else
"redis://localhost:6379"
end
# Redis::Store does not handle Unix sockets well, so let's do it for them
redis_config_hash
=
Redis
::
Store
::
Factory
.
extract_host_options_from_uri
(
redis_url_string
)
redis_uri
=
URI
.
parse
(
redis_url_string
)
if
redis_uri
.
scheme
==
'unix'
redis_config_hash
[
:path
]
=
redis_uri
.
path
end
redis_config_hash
[
:namespace
]
=
'cache:gitlab'
config
.
cache_store
=
:redis_store
,
redis_config_hash
end
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