Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
imTigger committed May 9, 2017
1 parent 702f430 commit 0c025c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,12 @@ $jobStatus = JobStatus::find($jobStatusId);
```php
<?php
// Job protected methods
$this->prepareStatus(); // Must be called in constructor before any other methods
$this->setProgressMax(int $v); // Update the max number of progress
$this->setProgressNow(int $v); // Update the current number progress
$this->setInput(array $v); // Store input into database
$this->setOutput(array $v); // Store output into database (Typically the run result)
$this->prepareStatus(); // Must be called in constructor before any other methods
$this->setProgressMax(int $v); // Update the max number of progress
$this->setProgressNow(int $v); // Update the current number progress
$this->setProgressNow(int $v, int $every); // Update the current number progress only if $v % $every == 0 (To reduce database write)
$this->setInput(array $v); // Store input into database
$this->setOutput(array $v); // Store output into database (Typically the run result)


// Job public methods
Expand Down
4 changes: 2 additions & 2 deletions src/Trackable.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ protected function setProgressMax(int $value)
$this->update(['progress_max' => $value]);
}

protected function setProgressNow(int $value, int $updateEvery = 1)
protected function setProgressNow(int $value, int $every = 1)
{
if ($value % $updateEvery == 0) {
if ($value % $every == 0) {
$this->update(['progress_now' => $value]);
}
}
Expand Down

0 comments on commit 0c025c8

Please sign in to comment.