Открыть боковую панель
nt_test132
nt_project_7gohtg18g8li
Коммиты
24ffbc43
Коммит
24ffbc43
создал
Ноя 09, 2017
по автору
Michael Kozono
Просмотр файлов
Remove unnecessary clearing
Since duplicate inserts are now ignored.
владелец
07604c83
Изменения
2
Скрыть пробелы
Построчно
Рядом
lib/gitlab/background_migration/prepare_untracked_uploads.rb
Просмотр файла @
24ffbc43
...
...
@@ -17,7 +17,6 @@ class UntrackedFile < ActiveRecord::Base
def
perform
return
unless
migrate?
clear_untracked_file_paths
store_untracked_file_paths
schedule_populate_untracked_uploads_jobs
end
...
...
@@ -28,10 +27,6 @@ def migrate?
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
Просмотр файла @
24ffbc43
...
...
@@ -68,14 +68,14 @@
# 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
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать