Commit de0e105f authored by shajiaiming's avatar shajiaiming

fix

parent 8c44a276
......@@ -59,13 +59,6 @@ trait TraitYiiHashTable
return Yii::$app->redis->hset($table, $key, $value);
}
public static function getHashDataByTable($table, $cursor = 0, $match = null, $pattern = null, $count = 0)
{
self::checkTable(self::DB_NAME, $table);
$table = self::getHashTable(self::DB_NAME, $table);
return Yii::$app->redis->hscan($table, $cursor/*, $match, $pattern, $count*/);
}
private static function checkTable($db_name, $table)
{
DefaultBaseImpl::checkTable($db_name, $table);
......
......@@ -43,11 +43,11 @@ class CurlHttpClient
const METHOD_POST = 'POST';
const METHOD_GET = 'GET';
public function __construct()
public function __construct($config = [])
{
$config = \Yii::$app->fpf->loadConfig('http_options');
$this->connect_timeout_ms = $config['connect_timeout'] ?? 10;
$this->timeout_ms = $config['timeout_ms'] ?? 100;
$http_option = \Yii::$app->fpf->loadConfig('http_options');
$this->connect_timeout_ms = isset($config['connect_timeout']) ? $config['connect_timeout'] : ($http_option['connect_timeout'] ?? 10);
$this->timeout_ms = isset($config['timeout_ms']) ? $config['timeout_ms'] : ($http_option['timeout_ms'] ?? 100) ;
}
/**
......@@ -87,6 +87,7 @@ class CurlHttpClient
if (!empty($options['cookies'])) {
$this->cookies = $options['cookies'];
}
echo $this->timeout_ms;exit;
$this->method = self::METHOD_GET;
$this->flush();
return $this->response;
......
......@@ -12,12 +12,12 @@ class FpfHttpClient
*/
private $http_client;
public function __construct()
public function __construct($config = [])
{
if (defined('IS_SWOOLE_SERVICE') && IS_SWOOLE_SERVICE === true) {
$this->http_client = new SwooleHttpClient();
} else {
$this->http_client = new CurlHttpClient();
$this->http_client = new CurlHttpClient($config);
}
}
......
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