Background Importer - Update process before finish

This commit is contained in:
Eduardo Humberto 2018-12-12 21:21:01 -02:00
parent fe283d37f6
commit 12d75801a1
1 changed files with 7 additions and 4 deletions

View File

@ -39,6 +39,11 @@ class Background_Importer extends Background_Process {
$this->write_log($key, $object->get_log());
$this->write_error_log($key, $object->get_error_log());
$batch->progress_label = $object->get_progress_label();
$batch->progress_value = $object->get_progress_value();
$batch->data = $object->_to_Array(true);
if( count($object->get_error_log()) > 0 ){
$this->set_finish_status(2);
}
@ -49,13 +54,11 @@ class Background_Importer extends Background_Process {
}
if (false === $runned) {
$this->update($key, $batch);
return false;
}
$batch->progress_label = $object->get_progress_label();
$batch->progress_value = $object->get_progress_value();
$batch->data = $object->_to_Array(true);
return $batch;
}