1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-09-16 08:36:30 +02:00

Merge pull request #260 from elebore/master

just update the pool configuration of rpcClient  if the options changed
This commit is contained in:
Asim Aslam
2018-05-26 09:03:16 +01:00
committed by GitHub

View File

@@ -202,9 +202,12 @@ func (r *rpcClient) Init(opts ...Option) error {
o(&r.opts)
}
// recreate the pool if the options changed
// update pool configuration if the options changed
if size != r.opts.PoolSize || ttl != r.opts.PoolTTL {
r.pool = newPool(r.opts.PoolSize, r.opts.PoolTTL)
r.pool.Lock()
r.pool.size = r.opts.PoolSize
r.pool.ttl = int64(r.opts.PoolTTL.Seconds())
r.pool.Unlock()
}
return nil