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
6e23fc3e
Commit
6e23fc3e
authored
Dec 15, 2021
by
Sean Arnold
Committed by
Douglas Barbosa Alexandre
Jan 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enqueue all issues, at 50k batches
parent
4c8135b0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
db/migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb
...1214012507_backfill_incident_issue_escalation_statuses.rb
+2
-4
spec/migrations/20211214012507_backfill_incident_issue_escalation_statuses_spec.rb
...12507_backfill_incident_issue_escalation_statuses_spec.rb
+6
-4
No files found.
db/migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb
View file @
6e23fc3e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
class
BackfillIncidentIssueEscalationStatuses
<
Gitlab
::
Database
::
Migration
[
1.0
]
class
BackfillIncidentIssueEscalationStatuses
<
Gitlab
::
Database
::
Migration
[
1.0
]
MIGRATION
=
'BackfillIncidentIssueEscalationStatuses'
MIGRATION
=
'BackfillIncidentIssueEscalationStatuses'
DELAY_INTERVAL
=
2
.
minutes
DELAY_INTERVAL
=
2
.
minutes
BATCH_SIZE
=
1
_000
BATCH_SIZE
=
50
_000
disable_ddl_transaction!
disable_ddl_transaction!
...
@@ -11,12 +11,10 @@ class BackfillIncidentIssueEscalationStatuses < Gitlab::Database::Migration[1.0]
...
@@ -11,12 +11,10 @@ class BackfillIncidentIssueEscalationStatuses < Gitlab::Database::Migration[1.0]
include
EachBatch
include
EachBatch
self
.
table_name
=
'issues'
self
.
table_name
=
'issues'
scope
:incidents
,
->
{
where
(
issue_type:
1
)
}
end
end
def
up
def
up
relation
=
Issue
.
incidents
relation
=
Issue
.
all
queue_background_migration_jobs_by_range_at_intervals
(
queue_background_migration_jobs_by_range_at_intervals
(
relation
,
MIGRATION
,
DELAY_INTERVAL
,
batch_size:
BATCH_SIZE
,
track_jobs:
true
)
relation
,
MIGRATION
,
DELAY_INTERVAL
,
batch_size:
BATCH_SIZE
,
track_jobs:
true
)
...
...
spec/migrations/20211214012507_backfill_incident_issue_escalation_statuses_spec.rb
View file @
6e23fc3e
...
@@ -15,7 +15,7 @@ RSpec.describe BackfillIncidentIssueEscalationStatuses do
...
@@ -15,7 +15,7 @@ RSpec.describe BackfillIncidentIssueEscalationStatuses do
end
end
it
'schedules jobs for incident issues'
do
it
'schedules jobs for incident issues'
do
issues
.
create!
(
project_id:
project
.
id
)
# non-incident issue
issue
_1
=
issue
s
.
create!
(
project_id:
project
.
id
)
# non-incident issue
incident_1
=
issues
.
create!
(
project_id:
project
.
id
,
issue_type:
1
)
incident_1
=
issues
.
create!
(
project_id:
project
.
id
,
issue_type:
1
)
incident_2
=
issues
.
create!
(
project_id:
project
.
id
,
issue_type:
1
)
incident_2
=
issues
.
create!
(
project_id:
project
.
id
,
issue_type:
1
)
...
@@ -24,10 +24,12 @@ RSpec.describe BackfillIncidentIssueEscalationStatuses do
...
@@ -24,10 +24,12 @@ RSpec.describe BackfillIncidentIssueEscalationStatuses do
migrate!
migrate!
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
2
.
minutes
,
i
ncident_1
.
id
,
incident
_1
.
id
)
2
.
minutes
,
i
ssue_1
.
id
,
issue
_1
.
id
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
4
.
minutes
,
incident_2
.
id
,
incident_2
.
id
)
4
.
minutes
,
incident_1
.
id
,
incident_1
.
id
)
expect
(
BackgroundMigrationWorker
.
jobs
.
size
).
to
eq
(
2
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
6
.
minutes
,
incident_2
.
id
,
incident_2
.
id
)
expect
(
BackgroundMigrationWorker
.
jobs
.
size
).
to
eq
(
3
)
end
end
end
end
end
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