Update database with rip progress
Changes the status to RUNNING when the task is queued in Gearman, and updates the progress information each time gearman reports a status update.
This commit is contained in:
@@ -40,6 +40,9 @@ function gearman_created_callback($gearman_task) {
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$log = $main->log();
|
||||
|
||||
$job = HandBrakeCluster_Job::fromId($gearman_task->unique());
|
||||
$job->updateStatus(HandBrakeCluster_JobStatus::RUNNING);
|
||||
|
||||
$log->info("Job successfully queued with Gearman", $gearman_task->unique());
|
||||
}
|
||||
|
||||
@@ -59,7 +62,7 @@ function gearman_status_callback($gearman_task) {
|
||||
|
||||
$rip_progress = $gearman_task->taskNumerator() / $gearman_task->taskDenominator();
|
||||
if ($rip_progress > $status->ripProgress() + 0.1) {
|
||||
$status->updateRipProgress();
|
||||
$status->updateRipProgress($rip_progress);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user