Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gitlab-com
migration
Commits
00d63de4
Commit
00d63de4
authored
Aug 09, 2018
by
Brett Walker
Browse files
count the number of specific migration background jobs
parent
8119d7b3
Pipeline
#89022
passed with stage
in 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bin/scripts/02_failover/060_go/p02/030-await-sidekiq-drain.rb
100644 → 100755
View file @
00d63de4
...
...
@@ -27,8 +27,12 @@ def cronjob_can_be_disabled(cron_name)
end
def
handle_named_set
(
title
,
named_set
)
background_migrations
=
{}
queue_sizes
=
named_set
.
each_with_object
({})
do
|
job
,
hash
|
hash
[
job
.
queue
]
=
(
hash
[
job
.
queue
]
||
0
)
+
1
if
job
.
queue
==
'background_migration'
background_migrations
[
job
.
args
[
0
]]
=
(
background_migrations
[
job
.
args
[
0
]]
||
0
)
+
1
end
end
if
!
queue_sizes
.
empty?
...
...
@@ -37,6 +41,9 @@ def handle_named_set(title, named_set)
queue_sizes
.
each
do
|
k
,
v
|
status
=
queue_can_be_purged
(
k
)
?
" (purged)"
:
""
puts
"
#{
k
}
:
#{
v
}#{
status
}
"
if
k
==
'background_migration'
&&
!
background_migrations
.
empty?
background_migrations
.
each
{
|
klass
,
count
|
puts
"
#{
klass
}
:
#{
count
}
"
}
end
end
end
...
...
Write
Preview
Supports
Markdown
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