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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
c77a353d
Commit
c77a353d
authored
Nov 09, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary clearing
Since duplicate inserts are now ignored.
parent
1807bc16
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
7 deletions
+2
-7
lib/gitlab/background_migration/prepare_untracked_uploads.rb
lib/gitlab/background_migration/prepare_untracked_uploads.rb
+0
-5
spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb
...ab/background_migration/prepare_untracked_uploads_spec.rb
+2
-2
No files found.
lib/gitlab/background_migration/prepare_untracked_uploads.rb
View file @
c77a353d
...
...
@@ -17,7 +17,6 @@ module Gitlab
def
perform
return
unless
migrate?
clear_untracked_file_paths
store_untracked_file_paths
schedule_populate_untracked_uploads_jobs
end
...
...
@@ -28,10 +27,6 @@ module Gitlab
UntrackedFile
.
table_exists?
end
def
clear_untracked_file_paths
UntrackedFile
.
delete_all
end
def
store_untracked_file_paths
return
unless
Dir
.
exist?
(
UPLOAD_DIR
)
...
...
spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb
View file @
c77a353d
...
...
@@ -68,14 +68,14 @@ describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :migration, :side
# E.g. from a previous failed run of this background migration
context
'when there is existing data in untracked_files_for_uploads'
do
before
do
untracked_files_for_uploads
.
create
(
path:
'/foo/bar.jpg'
)
described_class
.
new
.
perform
end
it
'does not error or produce duplicates of existing data'
do
Sidekiq
::
Testing
.
fake!
do
expect
do
described_class
.
new
.
perform
end
.
to
change
{
untracked_files_for_uploads
.
count
}.
from
(
1
).
to
(
5
)
end
.
not_to
change
{
untracked_files_for_uploads
.
count
}.
from
(
5
)
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