Commit 96533bc0 authored by chenchuanwen's avatar chenchuanwen

bridgeReload

parent c25df01a
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
*/ */
require APPLICATION_PATH . '/scripts/crontab/common.php'; require APPLICATION_PATH . '/scripts/crontab/common.php';
error_reporting(E_ALL ^ E_NOTICE); error_reporting(E_ALL ^ E_NOTICE);
$conf = \Yaf\Registry::get('config')->get('redis.database.params');
$redisPublishName=\Yaf\Registry::get('config')->get('redis.redisPublishName');
function callback($instance,$channelName,$message){ function callback($instance,$channelName,$message){
try{ try{
$message=json_decode($message,true); $message=json_decode($message,true);
...@@ -30,11 +32,14 @@ function callback($instance,$channelName,$message){ ...@@ -30,11 +32,14 @@ function callback($instance,$channelName,$message){
} }
pcntl_signal_dispatch(); pcntl_signal_dispatch();
if (Signal::get() == SIGHUP) { if (Signal::get() == SIGHUP) {
global $redis;
global $redisPublishName;
$redis->unsubscribe($redisPublishName);
Signal::reset(); Signal::reset();
} }
} }
$conf = \Yaf\Registry::get('config')->get('redis.database.params');
$redisPublishName=\Yaf\Registry::get('config')->get('redis.redisPublishName');
$redis=new Redis(); $redis=new Redis();
$redis->connect($conf['host'], $conf['port']); $redis->connect($conf['host'], $conf['port']);
if(!empty($conf['password'])){ if(!empty($conf['password'])){
......
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