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
0e0d0175
Commit
0e0d0175
authored
Dec 22, 2020
by
Andreas Brandl
Committed by
Yannis Roussos
Dec 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More verbose scheduling output
parent
219df0a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
lib/gitlab/database/migrations/background_migration_helpers.rb
...itlab/database/migrations/background_migration_helpers.rb
+10
-0
No files found.
lib/gitlab/database/migrations/background_migration_helpers.rb
View file @
0e0d0175
...
...
@@ -100,6 +100,7 @@ module Gitlab
end
final_delay
=
0
batch_counter
=
0
model_class
.
each_batch
(
of:
batch_size
)
do
|
relation
,
index
|
start_id
,
end_id
=
relation
.
pluck
(
Arel
.
sql
(
"MIN(
#{
primary_column_name
}
), MAX(
#{
primary_column_name
}
)"
)).
first
...
...
@@ -112,8 +113,17 @@ module Gitlab
track_in_database
(
job_class_name
,
full_job_arguments
)
if
track_jobs
migrate_in
(
final_delay
,
job_class_name
,
full_job_arguments
)
batch_counter
+=
1
end
duration
=
initial_delay
+
delay_interval
*
batch_counter
say
<<~
SAY
Scheduled
#{
batch_counter
}
#{
job_class_name
}
jobs with a maximum of
#{
batch_size
}
records per batch and an interval of
#{
delay_interval
}
seconds.
The migration is expected to take at least
#{
duration
}
seconds. Expect all jobs to have completed after
#{
Time
.
zone
.
now
+
duration
}
."
SAY
final_delay
end
...
...
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