new task workflow02

fix bugs
This commit is contained in:
jygaulier
2012-06-04 16:44:59 +02:00
parent 969fed45d6
commit 893324dfcd
18 changed files with 964 additions and 193 deletions

View File

@@ -59,7 +59,7 @@ class module_console_taskrun extends Command
{
if ($this->task) {
$this->task->log(sprintf("signal %s received", $signo));
if ($signo == SIGTERM) {
if ($signo == SIGTERM || $signo == SIGINT) {
$this->task->setRunning(false);
}
}
@@ -113,7 +113,6 @@ class module_console_taskrun extends Command
$logfile = __DIR__ . '/../../../../logs/task_' . $task_id . '.log';
$handler = new Handler\RotatingFileHandler($logfile, 10);
$logger->pushHandler($handler);
$this->task = $task_manager->getTask($task_id, $logger);
register_tick_function(array($this, 'tick_handler'), true);
@@ -121,6 +120,8 @@ class module_console_taskrun extends Command
if (function_exists('pcntl_signal')) {
pcntl_signal(SIGTERM, array($this, 'sig_handler'));
pcntl_signal(SIGINT, array($this, 'sig_handler'));
// pcntl_signal(SIGKILL, array($this, 'sig_handler'));
}
try {