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
a9a1bf01
Commit
a9a1bf01
authored
Dec 10, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Gitlab::SafeRequestStore instead of RequestStore
parent
1c9b415d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
ee/lib/gitlab/geo.rb
ee/lib/gitlab/geo.rb
+4
-4
No files found.
ee/lib/gitlab/geo.rb
View file @
a9a1bf01
...
...
@@ -84,24 +84,24 @@ module Gitlab
end
def
self
.
cache_value
(
raw_key
,
&
block
)
return
yield
unless
RequestStore
.
active?
return
yield
unless
Gitlab
::
Safe
RequestStore
.
active?
key
=
cache_key_for
(
raw_key
)
RequestStore
.
fetch
(
key
)
do
Gitlab
::
Safe
RequestStore
.
fetch
(
key
)
do
# We need a short expire time as we can't manually expire on a secondary node
Rails
.
cache
.
fetch
(
key
,
expires_in:
15
.
seconds
)
{
yield
}
end
end
def
self
.
expire_cache!
return
true
unless
RequestStore
.
active?
return
true
unless
Gitlab
::
Safe
RequestStore
.
active?
CACHE_KEYS
.
each
do
|
raw_key
|
key
=
cache_key_for
(
raw_key
)
Rails
.
cache
.
delete
(
key
)
RequestStore
.
delete
(
key
)
Gitlab
::
Safe
RequestStore
.
delete
(
key
)
end
true
...
...
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