Skip to content

Commit 7b83c88

Browse files
authored
Merge pull request #66 from WeareJH/JDTB-61-remove-already-imported
JDTB-61 Remove check if source already imported
2 parents 9621939 + 0964b9e commit 7b83c88

File tree

3 files changed

+0
-57
lines changed

3 files changed

+0
-57
lines changed

src/Import/History.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/Import/Importer.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ class Importer
6060
*/
6161
private $locker;
6262

63-
/**
64-
* @var History
65-
*/
66-
private $history;
67-
6863
/**
6964
* @var ArchiverFactory
7065
*/
@@ -82,7 +77,6 @@ public function __construct(
8277
ReportFactory $reportFactory,
8378
ArchiverFactory $archiverFactory,
8479
Locker $locker,
85-
History $history,
8680
Indexer $indexer,
8781
Progress $progress
8882
) {
@@ -92,7 +86,6 @@ public function __construct(
9286
$this->archiverFactory = $archiverFactory;
9387
$this->reportFactory = $reportFactory;
9488
$this->locker = $locker;
95-
$this->history = $history;
9689
$this->indexer = $indexer;
9790

9891
$importSpecification->configure($this);
@@ -110,14 +103,6 @@ public function transform(callable $transform): void
110103

111104
private function canImport(Config $config, Report $report, Archiver $archiver): bool
112105
{
113-
if ($this->history->isImported($this->source)) {
114-
$report->addError('This import source has already been imported.');
115-
if ($config->get('archive_already_imported_files')) {
116-
$archiver->failed();
117-
}
118-
return false;
119-
}
120-
121106
if ($this->source instanceof Countable && $this->source->count() === 0) {
122107
$report->addError('Source is empty - no data to be imported.');
123108
return false;

src/Import/ImporterFactory.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ class ImporterFactory
3939
*/
4040
private $locker;
4141

42-
/**
43-
* @var History
44-
*/
45-
private $history;
46-
4742
/**
4843
* @var IndexerRegistry
4944
*/
@@ -64,7 +59,6 @@ public function __construct(
6459
Factory $archiverFactory,
6560
State $appState,
6661
Locker $locker,
67-
History $history,
6862
IndexerRegistry $indexerRegistry,
6963
ProgressFactory $progressFactory,
7064
OutputFactory $outputFactory
@@ -73,7 +67,6 @@ public function __construct(
7367
$this->archiverFactory = $archiverFactory;
7468
$this->appState = $appState;
7569
$this->locker = $locker;
76-
$this->history = $history;
7770
$this->indexerRegistry = $indexerRegistry;
7871
$this->progressFactory = $progressFactory;
7972
$this->outputFactory = $outputFactory;
@@ -88,7 +81,6 @@ public function create(Source $source, ImportSpecification $specification, Write
8881
$this->reportFactory,
8982
$this->archiverFactory,
9083
$this->locker,
91-
$this->history,
9284
new Indexer($this->indexerRegistry, $this->outputFactory->get()),
9385
$this->progressFactory->get()
9486
);

0 commit comments

Comments
 (0)