Commit 6140c7f0 authored by chenchuanwen's avatar chenchuanwen

bridgeReload

parent a1d1c18d
...@@ -5,11 +5,9 @@ ...@@ -5,11 +5,9 @@
* Date: 2019/1/17 0017 * Date: 2019/1/17 0017
* Time: 下午 2:29 * Time: 下午 2:29
*/ */
define("APPLICATION_PATH", realpath(dirname(__FILE__) . '/../../../')); //指向public的上一级 require APPLICATION_PATH . '/scripts/crontab/common.php';
error_reporting(E_ALL ^ E_NOTICE);
function callback($instance,$channelName,$message){ function callback($instance,$channelName,$message){
define("APPLICATION_PATH", realpath(dirname(__FILE__) . '/../../../')); //指向public的上一级
require APPLICATION_PATH . '/scripts/crontab/common.php';
error_reporting(E_ALL ^ E_NOTICE);
try{ try{
$message=json_decode($message,true); $message=json_decode($message,true);
$callInstance=$message['className']::getInstance(\Our\DbNameConst::masterDBConnectName); $callInstance=$message['className']::getInstance(\Our\DbNameConst::masterDBConnectName);
...@@ -30,8 +28,11 @@ function callback($instance,$channelName,$message){ ...@@ -30,8 +28,11 @@ function callback($instance,$channelName,$message){
}catch(Exception $ex){ }catch(Exception $ex){
echo $ex->getMessage(); echo $ex->getMessage();
} }
pcntl_signal_dispatch();
if (Signal::get() == SIGHUP) {
Signal::reset();
}
} }
require APPLICATION_PATH . '/scripts/crontab/common.php';
$conf = \Yaf\Registry::get('config')->get('redis.database.params'); $conf = \Yaf\Registry::get('config')->get('redis.database.params');
$redisPublishName=\Yaf\Registry::get('config')->get('redis.redisPublishName'); $redisPublishName=\Yaf\Registry::get('config')->get('redis.redisPublishName');
$redis=new Redis(); $redis=new Redis();
......
...@@ -37,17 +37,17 @@ class Test extends Logger ...@@ -37,17 +37,17 @@ class Test extends Logger
public function run() public function run()
{ {
require APPLICATION_PATH . '/scripts/crontab/push/runRedisBase.php'; include APPLICATION_PATH . '/scripts/crontab/push/runRedisBase.php';
// while (true) { while (true) {
// pcntl_signal_dispatch(); pcntl_signal_dispatch();
// printf(".123"); printf(".123");
// sleep(1); sleep(1);
// if (Signal::get() == SIGHUP) { if (Signal::get() == SIGHUP) {
// Signal::reset(); Signal::reset();
// break; break;
// } }
// } }
printf("\n"); printf("\n");
} }
} }
......
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