Skip to content

Commit

Permalink
Merge pull request #5 from innogames/extract-perform-job-function
Browse files Browse the repository at this point in the history
Extract function to perform a job only
  • Loading branch information
adlenton authored Jan 6, 2023
2 parents 8f0c63d + 805cf61 commit 095fc99
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ public function perform(JobInterface $job)
if ($this->options['pre_perform']) {
$this->options['pre_perform']();
}
$job->perform();

$this->performJob($job);

if ($this->options['post_perform']) {
$this->options['post_perform']();
}
Expand Down Expand Up @@ -772,6 +774,11 @@ protected function failJob($job, Exception $exception)
$this->getStatistic('failed')->incr();
}

protected function performJob(JobInterface $job): void
{
$job->perform();
}

/**
* Prepares the list of queues for a job to reserved
*
Expand Down

0 comments on commit 095fc99

Please sign in to comment.