Skip to content

Commit

Permalink
Avoid serialisation in human readable log messages
Browse files Browse the repository at this point in the history
It only does sprintf() on two occurrences in this class,
and not anywhere else. I can't see why it's necessary.
  • Loading branch information
chillu committed Sep 18, 2020
1 parent 4b230d1 commit 47b4df9
Showing 1 changed file with 5 additions and 32 deletions.
37 changes: 5 additions & 32 deletions src/Services/QueuedJobService.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,16 +476,7 @@ public function checkJobHealth($queue = null)
}

$this->getLogger()->error(
print_r(
[
'errno' => 0,
'errstr' => 'Broken jobs were found in the job queue',
'errfile' => __FILE__,
'errline' => __LINE__,
'errcontext' => [],
],
true
),
'Broken jobs were found in the job queue',
[
'file' => __FILE__,
'line' => __LINE__,
Expand Down Expand Up @@ -842,17 +833,8 @@ public function runJob($jobId)
);
if (!$jobDescriptor || !$jobDescriptor->exists()) {
$broken = true;
$this->getLogger()->error(
print_r(
[
'errno' => 0,
'errstr' => 'Job descriptor ' . $jobId . ' could not be found',
'errfile' => __FILE__,
'errline' => __LINE__,
'errcontext' => [],
],
true
),
$logger->error(
'Job descriptor ' . $jobId . ' could not be found',
[
'file' => __FILE__,
'line' => __LINE__,
Expand Down Expand Up @@ -1001,17 +983,8 @@ public function runJob($jobId)
$this->copyJobToDescriptor($job, $jobDescriptor);
$jobDescriptor->write();
} else {
$this->getLogger()->error(
print_r(
[
'errno' => 0,
'errstr' => 'Job descriptor has been set to null',
'errfile' => __FILE__,
'errline' => __LINE__,
'errcontext' => [],
],
true
),
$logger->error(
'Job descriptor has been set to null',
[
'file' => __FILE__,
'line' => __LINE__,
Expand Down

0 comments on commit 47b4df9

Please sign in to comment.