stanley-king 4 years ago
parent
commit
651d035337
3 changed files with 8 additions and 4 deletions
  1. 3 0
      docker-compose-test.yml
  2. 1 0
      extend/queue.logic.php
  3. 4 4
      queue/queuehandler.php

+ 3 - 0
docker-compose-test.yml

@@ -26,6 +26,9 @@ services:
     command: [docker-php-fpm-start]
     depends_on:
       - accredis
+    extra_hosts:
+          - "docker.hostip:172.18.0.1"
+          - "eth.hostip:172.17.153.106"
 
   accphp:
     image: php-zts-debug:7.3.18

+ 1 - 0
extend/queue.logic.php

@@ -151,6 +151,7 @@ class queue_logic
                         $data['box_status'] = $value['result'];
 
                         $ret = http_request($update_url,$resp,'POST');
+                        $ret = json_decode($ret,true);
                         if($ret == false || $ret['code'] != 0) {
                             Log::record("update box state error: cabinet={$cabinet['cabinet_code']},box={$box['box_number']}",log::DEBUG);
                         }

+ 4 - 4
queue/queuehandler.php

@@ -16,10 +16,10 @@ class queuehandler
         $port = $other_config['net_queue']['port'];
         if (ob_get_level()) ob_end_clean();
 
-        pcntl_signal(SIGINT,  [$this,'sig_handler']);
-        pcntl_signal(SIGHUP,  [$this,'sig_handler']);
-        pcntl_signal(SIGQUIT, [$this,'sig_handler']);
-        pcntl_signal(SIGTERM, [$this,'sig_handler']);
+//        pcntl_signal(SIGINT,  [$this,'sig_handler']);
+//        pcntl_signal(SIGHUP,  [$this,'sig_handler']);
+//        pcntl_signal(SIGQUIT, [$this,'sig_handler']);
+//        pcntl_signal(SIGTERM, [$this,'sig_handler']);
 
         $logic_queue = new queue_logic();
         $worker = new QueueServer($queue_name,$host,$port);