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
72aab740
Commit
72aab740
authored
Nov 10, 2021
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move code in initializers to module for reusing
parent
0b7ca3c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
config/initializers/postgres_partitioning.rb
config/initializers/postgres_partitioning.rb
+1
-5
lib/gitlab/database/partitioning.rb
lib/gitlab/database/partitioning.rb
+6
-0
No files found.
config/initializers/postgres_partitioning.rb
View file @
72aab740
...
...
@@ -35,8 +35,4 @@ unless Gitlab.jh?
])
end
begin
Gitlab
::
Database
::
Partitioning
.
sync_partitions
unless
ENV
[
'DISABLE_POSTGRES_PARTITION_CREATION_ON_STARTUP'
]
rescue
ActiveRecord
::
ActiveRecordError
,
PG
::
Error
# ignore - happens when Rake tasks yet have to create a database, e.g. for testing
end
Gitlab
::
Database
::
Partitioning
.
sync_partitions_ignore_db_error
lib/gitlab/database/partitioning.rb
View file @
72aab740
...
...
@@ -27,6 +27,12 @@ module Gitlab
registered_tables
.
merge
(
tables
)
end
def
sync_partitions_ignore_db_error
sync_partitions
unless
ENV
[
'DISABLE_POSTGRES_PARTITION_CREATION_ON_STARTUP'
]
rescue
ActiveRecord
::
ActiveRecordError
,
PG
::
Error
# ignore - happens when Rake tasks yet have to create a database, e.g. for testing
end
def
sync_partitions
(
models_to_sync
=
registered_for_sync
)
Gitlab
::
AppLogger
.
info
(
message:
'Syncing dynamic postgres partitions'
)
...
...
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