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
3648854f
Commit
3648854f
authored
Oct 14, 2020
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set statement timeout in seconds
parent
37b08fe6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
lib/gitlab/database/reindexing/concurrent_reindex.rb
lib/gitlab/database/reindexing/concurrent_reindex.rb
+1
-1
spec/lib/gitlab/database/reindexing/concurrent_reindex_spec.rb
...lib/gitlab/database/reindexing/concurrent_reindex_spec.rb
+2
-2
No files found.
lib/gitlab/database/reindexing/concurrent_reindex.rb
View file @
3648854f
...
...
@@ -111,7 +111,7 @@ module Gitlab
end
def
set_statement_timeout
execute
(
"SET statement_timeout TO
#{
STATEMENT_TIMEOUT
}
"
)
execute
(
"SET statement_timeout TO
'%ds'"
%
STATEMENT_TIMEOUT
)
yield
ensure
execute
(
'RESET statement_timeout'
)
...
...
spec/lib/gitlab/database/reindexing/concurrent_reindex_spec.rb
View file @
3648854f
...
...
@@ -111,7 +111,7 @@ RSpec.describe Gitlab::Database::Reindexing::ConcurrentReindex, '#perform' do
end
it
'replaces the existing index with an identical index'
do
expect
(
connection
).
to
receive
(
:execute
).
with
(
'SET statement_timeout TO
21600
'
).
twice
expect
(
connection
).
to
receive
(
:execute
).
with
(
'SET statement_timeout TO
\'21600s\'
'
).
twice
expect_to_execute_concurrently_in_order
(
create_index
)
...
...
@@ -136,7 +136,7 @@ RSpec.describe Gitlab::Database::Reindexing::ConcurrentReindex, '#perform' do
end
it
'replaces the existing index with an identical index'
do
expect
(
connection
).
to
receive
(
:execute
).
with
(
'SET statement_timeout TO
21600
'
).
exactly
(
3
).
times
expect
(
connection
).
to
receive
(
:execute
).
with
(
'SET statement_timeout TO
\'21600s\'
'
).
exactly
(
3
).
times
expect_to_execute_concurrently_in_order
(
drop_index
)
expect_to_execute_concurrently_in_order
(
create_index
)
...
...
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