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

@@ -116,7 +116,7 @@ class JobStatusController extends Controller
public function start(ImportJob $importJob): JsonResponse
{
// catch impossible status:
$allowed = ['ready_to_run', 'need_job_config','error','running'];
$allowed = ['ready_to_run', 'need_job_config'];
// todo remove error and running.
if (null !== $importJob && !\in_array($importJob->status, $allowed, true)) {
@@ -174,7 +174,7 @@ class JobStatusController extends Controller
public function store(ImportJob $importJob): JsonResponse
{
// catch impossible status:
$allowed = ['provider_finished', 'storing_data','error'];
$allowed = ['provider_finished', 'storing_data'];
if (null !== $importJob && !\in_array($importJob->status, $allowed, true)) {
Log::error('Job is not ready.');