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
976adcf5
Commit
976adcf5
authored
Apr 24, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix merge conflicts for Banzai::Renderer
parent
bf466b33
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
21 deletions
+8
-21
lib/banzai/renderer.rb
lib/banzai/renderer.rb
+1
-5
spec/lib/banzai/renderer_spec.rb
spec/lib/banzai/renderer_spec.rb
+7
-16
No files found.
lib/banzai/renderer.rb
View file @
976adcf5
...
@@ -157,13 +157,9 @@ module Banzai
...
@@ -157,13 +157,9 @@ module Banzai
Rails
.
cache
.
send
(
:expanded_key
,
full_cache_key
(
cache_key
,
pipeline_name
))
Rails
.
cache
.
send
(
:expanded_key
,
full_cache_key
(
cache_key
,
pipeline_name
))
end
end
def
update_object
(
object
,
html_field
,
html
)
object
.
update_column
(
html_field
,
html
)
unless
Gitlab
::
Geo
.
secondary?
end
# GitLab EE needs to disable updates on GET requests in Geo
# GitLab EE needs to disable updates on GET requests in Geo
def
self
.
update_object?
(
object
)
def
self
.
update_object?
(
object
)
true
!
Gitlab
::
Geo
.
secondary?
end
end
end
end
end
end
spec/lib/banzai/renderer_spec.rb
View file @
976adcf5
...
@@ -14,22 +14,6 @@ describe Banzai::Renderer do
...
@@ -14,22 +14,6 @@ describe Banzai::Renderer do
let
(
:renderer
)
{
Banzai
::
Renderer
}
let
(
:renderer
)
{
Banzai
::
Renderer
}
subject
{
renderer
.
render_field
(
object
,
:field
)
}
subject
{
renderer
.
render_field
(
object
,
:field
)
}
context
"with an empty cache"
do
let
(
:object
)
{
fake_object
(
:markdown
)
}
it
"caches and returns the result"
do
expect_render
expect_cache_update
expect
(
subject
).
to
eq
(
:html
)
end
it
"skips database caching on a Geo secondary"
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:secondary?
).
and_return
(
true
)
expect_render
expect_cache_update
.
never
expect
(
subject
).
to
eq
(
:html
)
end
end
context
'with a stale cache'
do
context
'with a stale cache'
do
let
(
:object
)
{
fake_object
(
fresh:
false
)
}
let
(
:object
)
{
fake_object
(
fresh:
false
)
}
...
@@ -38,6 +22,13 @@ describe Banzai::Renderer do
...
@@ -38,6 +22,13 @@ describe Banzai::Renderer do
is_expected
.
to
eq
(
'field_html'
)
is_expected
.
to
eq
(
'field_html'
)
end
end
it
"skips database caching on a Geo secondary"
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:secondary?
).
and_return
(
true
)
expect
(
object
).
to
receive
(
:refresh_markdown_cache!
).
with
(
do_update:
false
)
is_expected
.
to
eq
(
'field_html'
)
end
end
end
context
'with an up-to-date cache'
do
context
'with an up-to-date cache'
do
...
...
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