stanley-king 2 лет назад
Родитель
Сommit
e5044eff03

+ 3 - 1
docker/compose/homecuda/cli/docker-compose.yml

@@ -51,4 +51,6 @@ services:
       - /mnt/xyzshop:/var/www/html
       - /mnt/shoplog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
-    container_name: "panda-python"
+    container_name: "panda-python"
+    extra_hosts:
+      - "docker.hostip:172.17.0.1"

+ 1 - 1
docker/compose/workcuda/conf/php/php.ini

@@ -1945,7 +1945,7 @@ output_buffering = On
 xdebug.default_enable=1
 xdebug.remote_enable=1
 xdebug.remote_handler=dbgp
-xdebug.remote_host=192.168.1.220
+xdebug.remote_host=192.168.3.220
 xdebug.remote_port=9300
 xdebug.remote_mode=jit
 xdebug.remote_autostart=1

+ 10 - 1
plot/ProfitCenter.py

@@ -1,3 +1,4 @@
+import json
 import os
 import time as stime
 import redis
@@ -51,7 +52,15 @@ class ProfitCenter(object):
 
     def read(self,queue,redis,hfive):
         while self._mquit == False:
-            val = redis.brpop(self.queue_name, 1)
+            item = redis.brpop(queue, 1)
+            if item is None:
+                continue
+            else:
+                val = json.loads(item[1])
+                self._parse(val)
+
+    def _parse(self,val):
+        print(val)
 
 
 

+ 16 - 1
plot/thdf5.py

@@ -163,9 +163,24 @@ class DataTest(unittest.TestCase):
         speedDataCenter.channl_speed()
 
     def test_profitPrepare(self):
-        profitCenter.set_redis('127.0.0.1','6379')
+        profitCenter.set_redis('docker.hostip','6379')
         profitCenter.prepare_data()
 
+
+    def test_json(self):
+        try:
+            x = {'method': 'commit', 'params': {'inprice': 4.5, 'outprice': 12}}
+            print(x)
+            # x = [ { 'a' : 1, 'b' : 2, 'c' : 3, 'd' : 4, 'e' : 5 } ]
+            data = json.dumps(x)
+            print(data)
+            y = json.loads(data)
+            print(y)
+        except Exception as ex:
+            print(ex)
+        finally:
+            pass
+
     def test_setcache(self):
         import json
         r = None