Simplify data returned from runAllJobs and fix logging bug in run-jobs
This commit is contained in:
@@ -244,7 +244,10 @@ class RippingCluster_Job {
|
|||||||
'subtitle_tracks' => $this->subtitle_tracks,
|
'subtitle_tracks' => $this->subtitle_tracks,
|
||||||
);
|
);
|
||||||
|
|
||||||
return array('HandBrake', array('rip_options' => $rip_options));
|
return array(
|
||||||
|
'method' => 'HandBrake',
|
||||||
|
'rip_options' => $rip_options
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function loadStatuses() {
|
protected function loadStatuses() {
|
||||||
|
|||||||
@@ -22,14 +22,14 @@ try {
|
|||||||
|
|
||||||
foreach ($jobs as $job) {
|
foreach ($jobs as $job) {
|
||||||
// Enqueue the job using gearman
|
// Enqueue the job using gearman
|
||||||
list($method, $rip_options) = $job->queue();
|
$args = $job->queue();
|
||||||
$task = new Net_Gearman_Task($method, $rip_options);
|
$task = new Net_Gearman_Task($args['method'], $args['rip_options']);
|
||||||
$task->attachCallback('gearman_complete', Net_Gearman_Task::TASK_COMPLETE);
|
$task->attachCallback('gearman_complete', Net_Gearman_Task::TASK_COMPLETE);
|
||||||
$task->attachCallback('gearman_fail', Net_Gearman_Task::TASK_FAIL);
|
$task->attachCallback('gearman_fail', Net_Gearman_Task::TASK_FAIL);
|
||||||
$set->addTask($task);
|
$set->addTask($task);
|
||||||
|
|
||||||
$job->updateStatus(RippingCluster_JobStatus::QUEUED);
|
$job->updateStatus(RippingCluster_JobStatus::QUEUED);
|
||||||
RippingCluster_ClientLogEntry::info($log, $rip_options['id'], 'Job queued', 'client');
|
RippingCluster_ClientLogEntry::info($log, $args['rip_options']['id'], 'Job queued', 'client');
|
||||||
}
|
}
|
||||||
|
|
||||||
$job_count = count($jobs);
|
$job_count = count($jobs);
|
||||||
|
|||||||
Reference in New Issue
Block a user