diff --git a/app/Libs/SimpleSSDB.php b/app/Libs/SimpleSSDB.php index b6920b2..c829bda 100644 --- a/app/Libs/SimpleSSDB.php +++ b/app/Libs/SimpleSSDB.php @@ -78,7 +78,7 @@ class SSDB function __construct($host, $port, $timeout_ms=2000){ $timeout_f = (float)$timeout_ms/1000; - $this->sock = @stream_socket_client("[$host]:$port", $errno, $errstr, $timeout_f); + $this->sock = @stream_socket_client("$host:$port", $errno, $errstr, $timeout_f); if(!$this->sock){ throw new SSDBException("$errno: $errstr"); } diff --git a/app/TaskWorker/SSDBTask.php b/app/TaskWorker/SSDBTask.php index 9c6ef29..fd4d451 100644 --- a/app/TaskWorker/SSDBTask.php +++ b/app/TaskWorker/SSDBTask.php @@ -24,6 +24,13 @@ class SSDBTask return $result; } + public function execWithoutTask($method,...$args) + { + $result = $this->client()->__call($method,$args); + + return $result; + } + protected function client(){ if ($this->ss instanceof SimpleSSDB) { return $this->ss;