Skip to content

Commit

Permalink
Merge pull request #66 from WeareJH/JDTB-61-remove-already-imported
Browse files Browse the repository at this point in the history
JDTB-61 Remove check if source already imported
  • Loading branch information
maciejslawik authored May 27, 2024
2 parents 9621939 + 0964b9e commit 7b83c88
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 57 deletions.
34 changes: 0 additions & 34 deletions src/Import/History.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Import/Importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ class Importer
*/
private $locker;

/**
* @var History
*/
private $history;

/**
* @var ArchiverFactory
*/
Expand All @@ -82,7 +77,6 @@ public function __construct(
ReportFactory $reportFactory,
ArchiverFactory $archiverFactory,
Locker $locker,
History $history,
Indexer $indexer,
Progress $progress
) {
Expand All @@ -92,7 +86,6 @@ public function __construct(
$this->archiverFactory = $archiverFactory;
$this->reportFactory = $reportFactory;
$this->locker = $locker;
$this->history = $history;
$this->indexer = $indexer;

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

private function canImport(Config $config, Report $report, Archiver $archiver): bool
{
if ($this->history->isImported($this->source)) {
$report->addError('This import source has already been imported.');
if ($config->get('archive_already_imported_files')) {
$archiver->failed();
}
return false;
}

if ($this->source instanceof Countable && $this->source->count() === 0) {
$report->addError('Source is empty - no data to be imported.');
return false;
Expand Down
8 changes: 0 additions & 8 deletions src/Import/ImporterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ class ImporterFactory
*/
private $locker;

/**
* @var History
*/
private $history;

/**
* @var IndexerRegistry
*/
Expand All @@ -64,7 +59,6 @@ public function __construct(
Factory $archiverFactory,
State $appState,
Locker $locker,
History $history,
IndexerRegistry $indexerRegistry,
ProgressFactory $progressFactory,
OutputFactory $outputFactory
Expand All @@ -73,7 +67,6 @@ public function __construct(
$this->archiverFactory = $archiverFactory;
$this->appState = $appState;
$this->locker = $locker;
$this->history = $history;
$this->indexerRegistry = $indexerRegistry;
$this->progressFactory = $progressFactory;
$this->outputFactory = $outputFactory;
Expand All @@ -88,7 +81,6 @@ public function create(Source $source, ImportSpecification $specification, Write
$this->reportFactory,
$this->archiverFactory,
$this->locker,
$this->history,
new Indexer($this->indexerRegistry, $this->outputFactory->get()),
$this->progressFactory->get()
);
Expand Down

0 comments on commit 7b83c88

Please sign in to comment.