fix bug
This commit is contained in:
parent
438147dbd8
commit
deb3dadbe4
|
@ -21,14 +21,13 @@ class ClientServiceProvider extends BaseServiceProvider
|
||||||
if (!is_array($config)) {
|
if (!is_array($config)) {
|
||||||
throw new RpcServerException("Application's Rpc Client Config Undefind", 500);
|
throw new RpcServerException("Application's Rpc Client Config Undefind", 500);
|
||||||
}
|
}
|
||||||
$client = new Client($config);
|
$this->app->singleton('rpc', function () use ($config) {
|
||||||
$this->app->singleton('rpc', function () use ($client) {
|
return new Client($config);
|
||||||
return $client;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach ($config['client'] as $k => $item) {
|
foreach ($config['client'] as $k => $item) {
|
||||||
$this->app->singleton('rpc.' . $k, function () use ($k, $client) {
|
$this->app->singleton('rpc.' . $k, function () use ($k, $config) {
|
||||||
return $client->endpoint($k);
|
return (new Client($config))->endpoint($k);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user