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
f917fc5d
Commit
f917fc5d
authored
Feb 08, 2018
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix last batch size equals max batch size error
parent
bbfec704
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
lib/gitlab/background_migration/prepare_untracked_uploads.rb
lib/gitlab/background_migration/prepare_untracked_uploads.rb
+1
-1
spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb
...ab/background_migration/prepare_untracked_uploads_spec.rb
+24
-0
No files found.
lib/gitlab/background_migration/prepare_untracked_uploads.rb
View file @
f917fc5d
...
@@ -92,7 +92,7 @@ module Gitlab
...
@@ -92,7 +92,7 @@ module Gitlab
end
end
end
end
yield
(
paths
)
yield
(
paths
)
if
paths
.
any?
end
end
def
build_find_command
(
search_dir
)
def
build_find_command
(
search_dir
)
...
...
spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb
View file @
f917fc5d
...
@@ -133,6 +133,18 @@ describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :sidekiq do
...
@@ -133,6 +133,18 @@ describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :sidekiq do
context
'when there are files in /uploads/tmp'
do
context
'when there are files in /uploads/tmp'
do
it_behaves_like
'does not add files in /uploads/tmp'
it_behaves_like
'does not add files in /uploads/tmp'
end
end
context
'when the last batch size exactly matches the max batch size'
do
it
'does not raise error'
do
stub_const
(
"
#{
described_class
}
::FIND_BATCH_SIZE"
,
5
)
expect
do
described_class
.
new
.
perform
end
.
not_to
raise_error
expect
(
untracked_files_for_uploads
.
count
).
to
eq
(
5
)
end
end
end
end
end
end
...
@@ -205,6 +217,18 @@ describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :sidekiq do
...
@@ -205,6 +217,18 @@ describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :sidekiq do
context
'when there are files in /uploads/tmp'
do
context
'when there are files in /uploads/tmp'
do
it_behaves_like
'does not add files in /uploads/tmp'
it_behaves_like
'does not add files in /uploads/tmp'
end
end
context
'when the last batch size exactly matches the max batch size'
do
it
'does not raise error'
do
stub_const
(
"
#{
described_class
}
::FIND_BATCH_SIZE"
,
5
)
expect
do
described_class
.
new
.
perform
end
.
not_to
raise_error
expect
(
untracked_files_for_uploads
.
count
).
to
eq
(
5
)
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