Browse Source

SSDB Task修改

(cherry picked from commit e5ead24208)
master
weigang 5 years ago
parent
commit
e3b323d2a7
  1. 2
      app/Libs/SimpleSSDB.php
  2. 7
      app/TaskWorker/SSDBTask.php

2
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");
}

7
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;

Loading…
Cancel
Save