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
c0cd209e
Commit
c0cd209e
authored
Feb 18, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
efc39d11
8f2221a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
4 deletions
+17
-4
app/models/concerns/reactive_caching.rb
app/models/concerns/reactive_caching.rb
+1
-1
changelogs/unreleased/56851-blank-values-in-reactive-cache.yml
...elogs/unreleased/56851-blank-values-in-reactive-cache.yml
+5
-0
spec/models/concerns/reactive_caching_spec.rb
spec/models/concerns/reactive_caching_spec.rb
+10
-2
spec/support/helpers/reactive_caching_helpers.rb
spec/support/helpers/reactive_caching_helpers.rb
+1
-1
No files found.
app/models/concerns/reactive_caching.rb
View file @
c0cd209e
...
...
@@ -76,7 +76,7 @@ module ReactiveCaching
begin
data
=
Rails
.
cache
.
read
(
full_reactive_cache_key
(
*
args
))
yield
data
if
data
.
present
?
yield
data
unless
data
.
nil
?
rescue
InvalidateReactiveCache
refresh_reactive_cache!
(
*
args
)
nil
...
...
changelogs/unreleased/56851-blank-values-in-reactive-cache.yml
0 → 100644
View file @
c0cd209e
---
title
:
Allow empty values such as [] to be stored in reactive cache
merge_request
:
25283
author
:
type
:
fixed
spec/models/concerns/reactive_caching_spec.rb
View file @
c0cd209e
...
...
@@ -25,7 +25,7 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do
def
result
with_reactive_cache
do
|
data
|
data
/
2
data
end
end
end
...
...
@@ -64,7 +64,7 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do
stub_reactive_cache
(
instance
,
4
)
end
it
{
is_expected
.
to
eq
(
2
)
}
it
{
is_expected
.
to
eq
(
4
)
}
it
'does not enqueue a background worker'
do
expect
(
ReactiveCachingWorker
).
not_to
receive
(
:perform_async
)
...
...
@@ -94,6 +94,14 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do
end
end
end
context
'when cache contains non-nil but blank value'
do
before
do
stub_reactive_cache
(
instance
,
false
)
end
it
{
is_expected
.
to
eq
(
false
)
}
end
end
describe
'#clear_reactive_cache!'
do
...
...
spec/support/helpers/reactive_caching_helpers.rb
View file @
c0cd209e
...
...
@@ -10,7 +10,7 @@ module ReactiveCachingHelpers
def
stub_reactive_cache
(
subject
=
nil
,
data
=
nil
,
*
qualifiers
)
allow
(
ReactiveCachingWorker
).
to
receive
(
:perform_async
)
allow
(
ReactiveCachingWorker
).
to
receive
(
:perform_in
)
write_reactive_cache
(
subject
,
data
,
*
qualifiers
)
if
data
write_reactive_cache
(
subject
,
data
,
*
qualifiers
)
unless
data
.
nil?
end
def
synchronous_reactive_cache
(
subject
)
...
...
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