Make sure number of steps is always correct.

This commit is contained in:
James Cole
2018-01-13 07:36:44 +01:00
parent ce854fbb43
commit 50882f309b
12 changed files with 194 additions and 69 deletions

View File

@@ -212,7 +212,7 @@ class Account extends Model
*
* @return string
*/
public function getNameAttribute($value): string
public function getNameAttribute($value): ?string
{
if ($this->encrypted) {
return Crypt::decrypt($value);

View File

@@ -173,30 +173,6 @@ class ImportJob extends Model
}
}
/**
* @param int $steps
*/
public function setStepsDone(int $steps)
{
$status = $this->extended_status;
$status['done'] = $steps;
$this->extended_status = $status;
$this->save();
Log::debug(sprintf('Set steps done for job "%s" to %d', $this->key, $steps));
}
/**
* @param int $count
*/
public function setTotalSteps(int $count)
{
$status = $this->extended_status;
$status['steps'] = $count;
$this->extended_status = $status;
$this->save();
Log::debug(sprintf('Set total steps for job "%s" to %d', $this->key, $count));
}
/**
* @return string
*