Skip to content

Commit 3fc79b9

Browse files
committed
feat: use same default size option value for local and ftp import
1 parent 955afd0 commit 3fc79b9

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Command/Uploads/ImportUploadsCommand.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected function configure()
7373
->addArgument('path', InputArgument::OPTIONAL, 'The path to the files to import')
7474
->addOption('environment', null, InputOption::VALUE_REQUIRED, 'The environment to upload files to', 'staging')
7575
->addOption('force', null, InputOption::VALUE_NONE, 'Force the import to run')
76-
->addOption('size', null, InputOption::VALUE_REQUIRED, 'The number of files to process at a time');
76+
->addOption('size', null, InputOption::VALUE_REQUIRED, 'The number of files to process at a time', 1000);
7777
}
7878

7979
/**
@@ -95,12 +95,6 @@ protected function perform(InputInterface $input, OutputInterface $output)
9595
$filesystem = new Filesystem($adapter);
9696
$size = $this->getNumericOption($input, 'size');
9797

98-
if (null === $size && $adapter instanceof LocalFilesystemAdapter) {
99-
$size = 1000;
100-
} elseif (null === $size) {
101-
$size = 100;
102-
}
103-
10498
if ($size < 1) {
10599
throw new InvalidArgumentException('Cannot have a "size" smaller than 1');
106100
}
@@ -117,6 +111,10 @@ protected function perform(InputInterface $input, OutputInterface $output)
117111
$total = 0;
118112
$progressBar->setMessage((string) $total, 'total');
119113

114+
if (!$adapter instanceof LocalFilesystemAdapter) {
115+
$output->infoWithWarning('Scanning remote "uploads" directory', 'takes a few seconds');
116+
}
117+
120118
$requests = LazyCollection::make(function () use ($filesystem) {
121119
$files = $filesystem->listContents('', Filesystem::LIST_DEEP)->filter(function (StorageAttributes $attributes) {
122120
return $attributes->isFile();

0 commit comments

Comments
 (0)