stanley-king il y a 3 ans
Parent
commit
d93a1d2429
3 fichiers modifiés avec 22 ajouts et 13 suppressions
  1. 11 0
      plot/thdf5.py
  2. 1 2
      rdispatcher/codispatcher.php
  3. 10 11
      test/TestBigData.php

Fichier diff supprimé car celui-ci est trop grand
+ 11 - 0
plot/thdf5.py


+ 1 - 2
rdispatcher/codispatcher.php

@@ -82,8 +82,7 @@ function subscribe_message(&$quit, &$redis, $channels)
                     elseif($type == 'ratio') {
                         Log::record("subscribe_message recv mgs:{$sub_type}-{$channel}-{$type}",Log::DEBUG);
                         $ins = Cache::getInstance('cacheredis');
-                        $val = $ins->get('channel_ratios');
-                        Log::record("subscribe_message channel_ratios val={$val}",Log::DEBUG);
+                        $val = $ins->get_org('channel_ratios');
                         if(empty($val)) continue;
                         $val = json_decode($val,true);
                         if(empty($val)) continue;

+ 10 - 11
test/TestBigData.php

@@ -29,17 +29,16 @@ class TestBigData extends TestCase
         refill\RefillFactory::instance()->UpdateRatio($ratios);
     }
 
-    public function testSort()
+    public function testCache()
     {
-        $out_price =
-        $desc_profit = function ($l, $r) use($out_price) {
-            [$lSucc,$lRatio] = $l->notify_ratio();
-            [$rSucc,$rRatio] = $r->notify_ratio();
-
-            $lprofit = ($out_price - $l->price()) * $lRatio;
-            $rprofit = ($out_price - $r->price()) * $rRatio;
-            return $lprofit < $rprofit ? 1 : -1;
-        };
-        usort($ratio_ctls, $desc_profit);
+        $ins = Cache::getInstance('cacheredis');
+        $val = $ins->get_org('channel_ratios');
+        Log::record("subscribe_message channel_ratios val={$val}",Log::DEBUG);
+        if(empty($val));
+        $val = json_decode($val,true);
+        if(empty($val));
+        $ratios = $val['ratios'];
+        if(empty($ratios));
+
     }
 }