Refactor some code to handle command line imports.

This commit is contained in:
James Cole
2018-05-12 19:09:34 +02:00
parent 07da2fdda3
commit 9c507f7f62
10 changed files with 248 additions and 85 deletions

View File

@@ -48,10 +48,8 @@ class FileRoutine implements RoutineInterface
public function run(): void
{
Log::debug(sprintf('Now in run() for file routine with status: %s', $this->importJob->status));
if ($this->importJob->status !== 'running') {
throw new FireflyException('This file import job should not be started.'); // @codeCoverageIgnore
}
if ($this->importJob->stage === 'ready_to_run') {
if ($this->importJob->status === 'ready_to_run') {
$this->repository->setStatus($this->importJob, 'running');
// get processor, depending on file type
// is just CSV for now.
$processor = $this->getProcessor();