Commit 9e70eda2 authored by chenchuanwen's avatar chenchuanwen

run

parent 6d4cdd48
...@@ -59,6 +59,10 @@ class runRedisPush ...@@ -59,6 +59,10 @@ class runRedisPush
$result=$redis->subscribe(array('redisPublish'), array($this,'callback')); $result=$redis->subscribe(array('redisPublish'), array($this,'callback'));
} }
protected function restart(){
$this->stop();
$this->start();
}
private function stop() private function stop()
{ {
...@@ -72,7 +76,7 @@ class runRedisPush ...@@ -72,7 +76,7 @@ class runRedisPush
private function help($proc) private function help($proc)
{ {
printf("%s start | stop | help \n", $proc); printf("%s start | stop | help | restart | reload \n", $proc);
} }
public function main($argv) public function main($argv)
...@@ -86,7 +90,9 @@ class runRedisPush ...@@ -86,7 +90,9 @@ class runRedisPush
$this->stop(); $this->stop();
} else if ($argv[1] === 'start') { } else if ($argv[1] === 'start') {
$this->start(); $this->start();
} else { } else if($argv[1] === 'restart'){
$this->restart();
}else{
$this->help($argv[0]); $this->help($argv[0]);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment