[#567] cmd/node: Close cached clients on shutdown
Call `CloseAll` on all `ClientCache` instances on application shutdown. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
bf92e895c0
commit
9b2939d538
3 changed files with 9 additions and 1 deletions
|
@ -72,13 +72,15 @@ func initContainerService(c *cfg) {
|
|||
PlacementBuilder: loadPlacementBuilder,
|
||||
})
|
||||
|
||||
clientCache := cache.NewSDKClientCache() // FIXME: use shared cache
|
||||
|
||||
loadRouter := loadroute.New(
|
||||
loadroute.Prm{
|
||||
LocalServerInfo: c,
|
||||
RemoteWriterProvider: &remoteLoadAnnounceProvider{
|
||||
key: c.key,
|
||||
loadAddrSrc: c,
|
||||
clientCache: cache.NewSDKClientCache(), // FIXME: use shared cache
|
||||
clientCache: clientCache,
|
||||
deadEndProvider: loadcontroller.SimpleWriterProvider(loadAccumulator),
|
||||
},
|
||||
Builder: routeBuilder,
|
||||
|
@ -86,6 +88,8 @@ func initContainerService(c *cfg) {
|
|||
loadroute.WithLogger(c.log),
|
||||
)
|
||||
|
||||
c.onShutdown(clientCache.CloseAll)
|
||||
|
||||
ctrl := loadcontroller.New(
|
||||
loadcontroller.Prm{
|
||||
LocalMetrics: loadcontroller.SimpleIteratorProvider(localMetrics),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue