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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
790ea015
Commit
790ea015
authored
Jul 02, 2020
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert Redis cache initialization change
parent
af74b807
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
config/application.rb
config/application.rb
+16
-0
config/initializers/7_redis.rb
config/initializers/7_redis.rb
+0
-11
No files found.
config/application.rb
View file @
790ea015
...
@@ -17,11 +17,16 @@ module Gitlab
...
@@ -17,11 +17,16 @@ module Gitlab
class
Application
<
Rails
::
Application
class
Application
<
Rails
::
Application
require_dependency
Rails
.
root
.
join
(
'lib/gitlab'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/utils'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/utils'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/wrapper'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/cache'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/queues'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/shared_state'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/current_settings'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/current_settings'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/middleware/read_only'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/middleware/read_only'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/middleware/basic_health_check'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/middleware/basic_health_check'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/middleware/same_site_cookies'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/middleware/same_site_cookies'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/middleware/handle_ip_spoof_attack_error'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/middleware/handle_ip_spoof_attack_error'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/runtime'
)
# Settings in config/environments/* take precedence over those specified here.
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# Application configuration should go into files in config/initializers
...
@@ -259,6 +264,17 @@ module Gitlab
...
@@ -259,6 +264,17 @@ module Gitlab
end
end
end
end
# Use caching across all environments
# Full list of options:
# https://api.rubyonrails.org/classes/ActiveSupport/Cache/RedisCacheStore.html#method-c-new
caching_config_hash
=
{}
caching_config_hash
[
:redis
]
=
Gitlab
::
Redis
::
Cache
.
pool
caching_config_hash
[
:compress
]
=
Gitlab
::
Utils
.
to_boolean
(
ENV
.
fetch
(
'ENABLE_REDIS_CACHE_COMPRESSION'
,
'1'
))
caching_config_hash
[
:namespace
]
=
Gitlab
::
Redis
::
Cache
::
CACHE_NAMESPACE
caching_config_hash
[
:expires_in
]
=
2
.
weeks
# Cache should not grow forever
config
.
cache_store
=
:redis_cache_store
,
caching_config_hash
config
.
active_job
.
queue_adapter
=
:sidekiq
config
.
active_job
.
queue_adapter
=
:sidekiq
# This is needed for gitlab-shell
# This is needed for gitlab-shell
...
...
config/initializers/7_redis.rb
View file @
790ea015
# Use caching across all environments
# Full list of options:
# https://api.rubyonrails.org/classes/ActiveSupport/Cache/RedisCacheStore.html#method-c-new
caching_config_hash
=
{}
caching_config_hash
[
:redis
]
=
Gitlab
::
Redis
::
Cache
.
pool
caching_config_hash
[
:compress
]
=
Gitlab
::
Utils
.
to_boolean
(
ENV
.
fetch
(
'ENABLE_REDIS_CACHE_COMPRESSION'
,
'1'
))
caching_config_hash
[
:namespace
]
=
Gitlab
::
Redis
::
Cache
::
CACHE_NAMESPACE
caching_config_hash
[
:expires_in
]
=
2
.
weeks
# Cache should not grow forever
Gitlab
::
Application
.
config
.
cache_store
=
:redis_cache_store
,
caching_config_hash
# Make sure we initialize a Redis connection pool before multi-threaded
# Make sure we initialize a Redis connection pool before multi-threaded
# execution starts by
# execution starts by
# 1. Sidekiq
# 1. Sidekiq
...
...
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