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
0c44c05b
Commit
0c44c05b
authored
Nov 13, 2019
by
David H. Wilkins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code review changes and add changelog
- move key assignment to abobve the cache lifetime check - add changelog
parent
eec780c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
app/models/concerns/reactive_caching.rb
app/models/concerns/reactive_caching.rb
+2
-2
changelogs/unreleased/reactive-caching-self-cleanup.yml
changelogs/unreleased/reactive-caching-self-cleanup.yml
+5
-0
No files found.
app/models/concerns/reactive_caching.rb
View file @
0c44c05b
...
...
@@ -129,16 +129,16 @@ module ReactiveCaching
def
exclusively_update_reactive_cache!
(
*
args
)
locking_reactive_cache
(
*
args
)
do
key
=
full_reactive_cache_key
(
*
args
)
if
within_reactive_cache_lifetime?
(
*
args
)
enqueuing_update
(
*
args
)
do
key
=
full_reactive_cache_key
(
*
args
)
new_value
=
calculate_reactive_cache
(
*
args
)
old_value
=
Rails
.
cache
.
read
(
key
)
Rails
.
cache
.
write
(
key
,
new_value
)
reactive_cache_updated
(
*
args
)
if
new_value
!=
old_value
end
else
Rails
.
cache
.
delete
(
full_reactive_cache_key
(
*
args
)
)
Rails
.
cache
.
delete
(
key
)
end
end
end
...
...
changelogs/unreleased/reactive-caching-self-cleanup.yml
0 → 100644
View file @
0c44c05b
---
title
:
reactive-caching-self-cleanup
merge_request
:
20111
author
:
type
:
performance
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