Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inc/class-logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public function __construct( $db, $table_prefix ) {
$this->table_prefix = $table_prefix;
}

public function log_job_completed( Job $job, $message = '' ) {
public function log_job_completed( Job $job, $message, Worker $worker ) {
$this->log_run( $job->id, 'completed', $message );
}

public function log_job_failed( Job $job, $message = '' ) {
public function log_job_failed( Job $job, $message, Worker $worker ) {
$this->log_run( $job->id, 'failed', $message );
}

Expand Down
4 changes: 2 additions & 2 deletions inc/class-runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ protected function check_workers() {

if ( ! $worker->shutdown() ) {
$worker->job->mark_failed();
$logger->log_job_failed( $worker->job, 'Failed to shutdown worker.' );
$logger->log_job_failed( $worker->job, 'Failed to shutdown worker.', $worker );

/**
* Action after a job has failed.
Expand All @@ -398,7 +398,7 @@ protected function check_workers() {
$this->hooks->run( 'Runner.check_workers.job_failed', $worker, $worker->job, $logger );
} else {
$worker->job->mark_completed();
$logger->log_job_completed( $worker->job );
$logger->log_job_completed( $worker->job, '', $worker );

/**
* Action after a job has failed.
Expand Down