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
ccc7363d
Commit
ccc7363d
authored
May 08, 2018
by
Brett Walker
Committed by
Stan Hu
May 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Getting "Geo secondary database is not configured" when only running EE (sha_attribute)
parent
dc2e0194
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
app/models/concerns/sha_attribute.rb
app/models/concerns/sha_attribute.rb
+5
-0
spec/models/concerns/sha_attribute_spec.rb
spec/models/concerns/sha_attribute_spec.rb
+13
-0
No files found.
app/models/concerns/sha_attribute.rb
View file @
ccc7363d
...
...
@@ -28,6 +28,11 @@ module ShaAttribute
unless
column
.
type
==
:binary
raise
ArgumentError
.
new
(
"sha_attribute
#{
name
.
inspect
}
is invalid since the column type is not :binary"
)
end
# EE-specific start
rescue
Geo
::
TrackingBase
::
SecondaryNotConfigured
# EE specific end
rescue
=>
error
Gitlab
::
AppLogger
.
error
"ShaAttribute initialization:
#{
error
.
message
}
"
raise
...
...
spec/models/concerns/sha_attribute_spec.rb
View file @
ccc7363d
...
...
@@ -68,6 +68,19 @@ describe ShaAttribute do
expect
{
model
.
sha_attribute
(
:name
)
}.
to
raise_error
(
ActiveRecord
::
NoDatabaseError
)
end
end
# EE-specific start
context
'when Geo database is not configured'
do
it
'allows the attribute to be added'
do
allow
(
model
).
to
receive
(
:table_exists?
).
and_raise
(
Geo
::
TrackingBase
::
SecondaryNotConfigured
.
new
)
expect
(
model
).
not_to
receive
(
:columns
)
expect
(
model
).
to
receive
(
:attribute
)
model
.
sha_attribute
(
:name
)
end
end
# EE specific end
end
context
'when in production'
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