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
2d98e2a3
Commit
2d98e2a3
authored
Nov 25, 2019
by
Ryan Cobb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add without_reactive_cache method
parent
be6c72dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
app/models/concerns/reactive_caching.rb
app/models/concerns/reactive_caching.rb
+6
-10
No files found.
app/models/concerns/reactive_caching.rb
View file @
2d98e2a3
...
...
@@ -106,8 +106,6 @@ module ReactiveCaching
end
def
with_reactive_cache
(
*
args
,
&
blk
)
return
reactive_cache_pry
(
*
args
,
&
blk
)
if
ENV
[
'REACTIVE_CACHE_PRY'
]
==
'true'
unless
within_reactive_cache_lifetime?
(
*
args
)
refresh_reactive_cache!
(
*
args
)
return
...
...
@@ -124,6 +122,12 @@ module ReactiveCaching
end
end
# This method is used for debugging purposes and should not be used otherwise.
def
without_reactive_cache
(
*
args
,
&
blk
)
data
=
self
.
class
.
reactive_cache_worker_finder
.
call
(
id
,
*
args
).
calculate_reactive_cache
(
*
args
)
yield
data
end
def
clear_reactive_cache!
(
*
args
)
Rails
.
cache
.
delete
(
full_reactive_cache_key
(
*
args
))
Rails
.
cache
.
delete
(
alive_reactive_cache_key
(
*
args
))
...
...
@@ -148,14 +152,6 @@ module ReactiveCaching
private
def
reactive_cache_pry
(
*
args
,
&
blk
)
data
=
Rails
.
cache
.
fetch
(
full_reactive_cache_key
(
*
args
),
expires_in:
5
.
seconds
)
do
self
.
class
.
reactive_cache_worker_finder
.
call
(
id
,
*
args
).
calculate_reactive_cache
(
*
args
)
end
yield
data
end
def
refresh_reactive_cache!
(
*
args
)
clear_reactive_cache!
(
*
args
)
keep_alive_reactive_cache!
(
*
args
)
...
...
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