Compare commits
9 Commits
release-0.
...
release-0.
| Author | SHA1 | Date | |
|---|---|---|---|
| a3e58e4ee4 | |||
| 3b22b0f2c9 | |||
| efb7db35d8 | |||
| 841a5b9f92 | |||
| 506a6e189c | |||
| 3da59727de | |||
| c0d8747b21 | |||
| e1bd324e84 | |||
| 8fe8f8ba08 |
@@ -12,7 +12,7 @@ depend() {
|
|||||||
start() {
|
start() {
|
||||||
ebegin "Starting ripping-cluster-worker"
|
ebegin "Starting ripping-cluster-worker"
|
||||||
start-stop-daemon --start --quiet \
|
start-stop-daemon --start --quiet \
|
||||||
--pidfile ${PID_FILE} \
|
--background --make-pidfile --pidfile ${PID_FILE} \
|
||||||
--exec /usr/bin/php /usr/lib/ripping-cluster/worker/ripping-cluster-worker.php
|
--exec /usr/bin/php /usr/lib/ripping-cluster/worker/ripping-cluster-worker.php
|
||||||
eend $? "Failed to start ripping-cluster-worker"
|
eend $? "Failed to start ripping-cluster-worker"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,16 @@ class RippingCluster_LogEntry extends SihnonFramework_LogEntry {
|
|||||||
|
|
||||||
protected $job_id;
|
protected $job_id;
|
||||||
|
|
||||||
|
protected static $types;
|
||||||
|
|
||||||
public static function initialise() {
|
public static function initialise() {
|
||||||
self::$types['job_id'] = 'int';
|
// Copy the list of datatypes from the parent
|
||||||
|
// We can't modify it in place, else we'll break any logging done inside the SihnonFramework tree
|
||||||
|
// or other subclass trees.
|
||||||
|
static::$types = parent::$types;
|
||||||
|
|
||||||
|
// Add the new data types for this subclass
|
||||||
|
static::$types['job_id'] = 'int';
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function __construct($level, $category, $ctime, $pid, $file, $line, $message, $job_id) {
|
protected function __construct($level, $category, $ctime, $pid, $file, $line, $message, $job_id) {
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once '../private/config.php';
|
require_once '/etc/ripping-cluster/config.php';
|
||||||
require_once(SihnonFramework_Lib . 'SihnonFramework/Main.class.php');
|
require_once SihnonFramework_Lib . 'SihnonFramework/Main.class.php';
|
||||||
//require_once RippingCluster_Lib . 'RippingCluster/Main.class.php';
|
|
||||||
|
|
||||||
SihnonFramework_Main::registerAutoloadClasses('SihnonFramework', SihnonFramework_Lib,
|
SihnonFramework_Main::registerAutoloadClasses('SihnonFramework', SihnonFramework_Lib,
|
||||||
'RippingCluster', SihnonFramework_Main::makeAbsolutePath('../source/lib/'));
|
'RippingCluster', RippingCluster_Lib);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
define('HBC_File', 'run-jobs');
|
define('HBC_File', 'run-jobs');
|
||||||
|
|
||||||
require_once '../private/config.php';
|
require_once '/etc/ripping-cluster/config.php';
|
||||||
require_once(SihnonFramework_Lib . 'SihnonFramework/Main.class.php');
|
require_once(SihnonFramework_Lib . 'SihnonFramework/Main.class.php');
|
||||||
require_once 'Net/Gearman/Client.php';
|
require_once 'Net/Gearman/Client.php';
|
||||||
|
|
||||||
SihnonFramework_Main::registerAutoloadClasses('SihnonFramework', SihnonFramework_Lib,
|
SihnonFramework_Main::registerAutoloadClasses('SihnonFramework', SihnonFramework_Lib,
|
||||||
'RippingCluster', SihnonFramework_Main::makeAbsolutePath('../source/lib/'));
|
'RippingCluster', RippingCluster_Lib);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$main = RippingCluster_Main::instance();
|
$main = RippingCluster_Main::instance();
|
||||||
@@ -34,7 +34,7 @@ try {
|
|||||||
// Start the job queue
|
// Start the job queue
|
||||||
$result = $client->runSet($set);
|
$result = $client->runSet($set);
|
||||||
|
|
||||||
RippingCluster_LogEntry::info($log, 'Job queue completed', 'batch');
|
RippingCluster_ClientLogEntry::info($log, null, 'Job queue completed', 'batch');
|
||||||
|
|
||||||
} catch (RippingCluster_Exception $e) {
|
} catch (RippingCluster_Exception $e) {
|
||||||
die("Uncaught Exception (" . get_class($e) . "): " . $e->getMessage() . "\n");
|
die("Uncaught Exception (" . get_class($e) . "): " . $e->getMessage() . "\n");
|
||||||
@@ -55,7 +55,7 @@ function gearman_fail($task) {
|
|||||||
$main = RippingCluster_Main::instance();
|
$main = RippingCluster_Main::instance();
|
||||||
$log = $main->log();
|
$log = $main->log();
|
||||||
|
|
||||||
$job = RippingCluster_Job::fromId($task->args['rip_options']['id']);
|
$job = RippingCluster_Job::fromId($task->arg['rip_options']['id']);
|
||||||
$job->updateStatus(RippingCluster_JobStatus::FAILED);
|
$job->updateStatus(RippingCluster_JobStatus::FAILED);
|
||||||
|
|
||||||
RippingCluster_ClientLogEntry::info($log, $job->id(), 'Job failed');
|
RippingCluster_ClientLogEntry::info($log, $job->id(), 'Job failed');
|
||||||
|
|||||||
Reference in New Issue
Block a user