Updated code to use new WorkerLogEntry class

This commit is contained in:
2011-04-25 00:54:28 +01:00
parent 180e63c456
commit 4e58ac7135
2 changed files with 5 additions and 4 deletions

View File

@@ -53,10 +53,10 @@ class Net_Gearman_Job_HandBrake extends Net_Gearman_Job_Common implements Rippin
$handbrake_cmd[] = escapeshellarg($value);
}
$handbrake_cmd = join(' ', $handbrake_cmd);
RippingCluster_LogEntry::debug($log, $this->job->id(), $handbrake_cmd, 'worker');
RippingCluster_WorkerLogEntry::debug($log, $this->job->id(), $handbrake_cmd);
// Change the status of this job to running
RippingCluster_LogEntry::debug($log, $this->job->id(), "Setting status to Running", 'worker');
RippingCluster_WorkerLogEntry::debug($log, $this->job->id(), "Setting status to Running");
$this->job->updateStatus(RippingCluster_JobStatus::RUNNING, 0);
list($return_val, $stdout, $stderr) = RippingCluster_ForegroundTask::execute($handbrake_cmd, null, null, null, array($this, 'callbackOutput'), array($this, 'callbackOutput'), $this);
@@ -110,7 +110,7 @@ class Net_Gearman_Job_HandBrake extends Net_Gearman_Job_Common implements Rippin
$this->status($matches[1], 100);
} else {
$log = RippingCluster_Main::instance()->log();
RippingCluster_LogEntry::debug($log, $rip->job->id(), $line, 'worker');
RippingCluster_WorkerLogEntry::debug($log, $rip->job->id(), $line);
}
}
}

View File

@@ -30,7 +30,8 @@ class RippingCluster_Worker {
try {
$this->gearman->beginWork();
} catch (Net_Gearman_Exception $e) {
// Do stuff
RippingCluster_WorkerLogEntry::error(SihnonFramework_Main::instance()->log(), 0, $e->toText());
return false;
}
return true;