Skip to content

Commit

Permalink
tars-client problem fix; exclude fpm from using swoole; fix problem o…
Browse files Browse the repository at this point in the history
…f tars server

修复tars-client的问题,在fpm的情况下禁止使用swoole table,修复tars-server的iReuqestId问题
  • Loading branch information
meijing0114 committed Sep 1, 2018
1 parent 83400be commit 1dc4ede
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion php/tars-client/src/TUPAPIWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public static function putMap($paramName, $tag, $map, $iVersion)
}
}

public function getMap($name, $tag, $obj, $sBuffer, $iVersion)
public static function getMap($name, $tag, $obj, $sBuffer, $iVersion)
{
try {
if ($iVersion === Consts::TARSVERSION) {
Expand Down
2 changes: 1 addition & 1 deletion php/tars-registry/src/QueryFWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function findObjectById($id)

// 这里你能起一个定时器么,i think not, 但是可以起swooletable
// 然后在server里面轮询,再去刷swooletable里面缓存的数据
if (class_exists('swoole_table')) {
if (class_exists('swoole_table') && php_sapi_name() !== "apache" && php_sapi_name() !== "fpm-fcgi") {
RouteTable::getInstance();
RouteTable::setRouteInfo($id, $routeInfo);
}
Expand Down
1 change: 0 additions & 1 deletion php/tars-server/src/protocol/TARSProtocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ public function packRsp($paramInfo, $unpackResult, $args, $returnVal)
// 完成所有的打包之后,开始编码
$cPacketType = 0;
$iMessageType = 0;
$iRequestId = 1; // 使用协程的id
$statuses = [];

$servantName = $unpackResult['sServantName'];
Expand Down

0 comments on commit 1dc4ede

Please sign in to comment.