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
3dfbfa4e
Commit
3dfbfa4e
authored
Nov 23, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust batch size for migrating runners token
parent
1143411a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
db/post_migrate/20181121111200_schedule_runners_token_encryption.rb
...grate/20181121111200_schedule_runners_token_encryption.rb
+2
-2
spec/migrations/schedule_runners_token_encryption_spec.rb
spec/migrations/schedule_runners_token_encryption_spec.rb
+7
-7
No files found.
db/post_migrate/20181121111200_schedule_runners_token_encryption.rb
View file @
3dfbfa4e
...
@@ -5,7 +5,7 @@ class ScheduleRunnersTokenEncryption < ActiveRecord::Migration
...
@@ -5,7 +5,7 @@ class ScheduleRunnersTokenEncryption < ActiveRecord::Migration
DOWNTIME
=
false
DOWNTIME
=
false
BATCH_SIZE
=
10000
BATCH_SIZE
=
10000
RANGE_SIZE
=
1
00
RANGE_SIZE
=
20
00
MIGRATION
=
'EncryptRunnersTokens'
MIGRATION
=
'EncryptRunnersTokens'
MODELS
=
[
MODELS
=
[
...
@@ -20,7 +20,7 @@ class ScheduleRunnersTokenEncryption < ActiveRecord::Migration
...
@@ -20,7 +20,7 @@ class ScheduleRunnersTokenEncryption < ActiveRecord::Migration
def
up
def
up
MODELS
.
each
do
|
model
|
MODELS
.
each
do
|
model
|
model
.
each_batch
(
of:
BATCH_SIZE
)
do
|
relation
,
index
|
model
.
each_batch
(
of:
BATCH_SIZE
)
do
|
relation
,
index
|
delay
=
index
*
2
.
minutes
delay
=
index
*
4
.
minutes
relation
.
each_batch
(
of:
RANGE_SIZE
)
do
|
relation
|
relation
.
each_batch
(
of:
RANGE_SIZE
)
do
|
relation
|
range
=
relation
.
pluck
(
'MIN(id)'
,
'MAX(id)'
).
first
range
=
relation
.
pluck
(
'MIN(id)'
,
'MAX(id)'
).
first
...
...
spec/migrations/schedule_runners_token_encryption_spec.rb
View file @
3dfbfa4e
...
@@ -24,13 +24,13 @@ describe ScheduleRunnersTokenEncryption, :migration do
...
@@ -24,13 +24,13 @@ describe ScheduleRunnersTokenEncryption, :migration do
Timecop
.
freeze
do
Timecop
.
freeze
do
migrate!
migrate!
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
2
.
minutes
,
'settings'
,
1
,
1
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
4
.
minutes
,
'settings'
,
1
,
1
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
2
.
minutes
,
'namespace'
,
11
,
11
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
4
.
minutes
,
'namespace'
,
11
,
11
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
4
.
minutes
,
'namespace'
,
12
,
12
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
8
.
minutes
,
'namespace'
,
12
,
12
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
2
.
minutes
,
'project'
,
111
,
111
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
4
.
minutes
,
'project'
,
111
,
111
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
4
.
minutes
,
'project'
,
114
,
114
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
8
.
minutes
,
'project'
,
114
,
114
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
2
.
minutes
,
'runner'
,
201
,
201
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
4
.
minutes
,
'runner'
,
201
,
201
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
4
.
minutes
,
'runner'
,
202
,
202
)
expect
(
described_class
::
MIGRATION
).
to
be_scheduled_delayed_migration
(
8
.
minutes
,
'runner'
,
202
,
202
)
expect
(
BackgroundMigrationWorker
.
jobs
.
size
).
to
eq
7
expect
(
BackgroundMigrationWorker
.
jobs
.
size
).
to
eq
7
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