Skip to content

Commit

Permalink
Merge pull request #20 from xiaocaigua/4.x
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
kiss291323003 authored Jan 4, 2020
2 parents 4d15e06 + e2f60f0 commit 54313c2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public function __hook(Request $request, Response $response, Coroutine\Socket $c
try {
if ($this->onRequest($this->action()) !== false) {
if (in_array($actionName, $this->allowMethods)) {
$actionName = $this->action();
$this->$actionName();
} else {
$this->actionNotFound($this->action());
Expand Down Expand Up @@ -147,5 +146,6 @@ protected function gc()
foreach ($this->defaultProperties as $property => $value) {
$this->{$property} = $value;
}
unset($this->request, $this->response, $this->socket, $this->action);
}
}
1 change: 1 addition & 0 deletions src/Rpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function () use ($service) {
'fail' => 0,
]);
}
return $config;
}
return null;
}
Expand Down
3 changes: 2 additions & 1 deletion test/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@
});

$client->exec();
});
});
swoole_timer_clear_all();
2 changes: 1 addition & 1 deletion test/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//$config->getBroadcastConfig()->setSecretKey('zhongguo');

$rpc = new Rpc($config);
$rpc->add(new UserService());
$rpc->add(new UserService())->setMinObjectNum(10)->setMaxObjectNum(20);
$rpc->add(new OrderService());
$rpc->add(new NodeService());

Expand Down

0 comments on commit 54313c2

Please sign in to comment.