Move changes from the support branch. #58

Merged
fyrchik merged 25 commits from move-changes into master 2023-02-20 10:53:28 +00:00
2 changed files with 24 additions and 13 deletions
Showing only changes of commit b679a724ef - Show all commits

View file

@ -344,6 +344,7 @@ type shared struct {
clientCache *cache.ClientCache
bgClientCache *cache.ClientCache
putClientCache *cache.ClientCache
localAddr network.AddressGroup
key *keys.PrivateKey
@ -576,6 +577,7 @@ func initCfg(appCfg *config.Config) *cfg {
respSvc: response.NewService(response.WithNetworkState(netState)),
clientCache: cache.NewSDKClientCache(cacheOpts),
bgClientCache: cache.NewSDKClientCache(cacheOpts),
putClientCache: cache.NewSDKClientCache(cacheOpts),
persistate: persistate,
}
c.cfgAccounting = cfgAccounting{
@ -617,6 +619,7 @@ func initCfg(appCfg *config.Config) *cfg {
c.onShutdown(c.clientCache.CloseAll) // clean up connections
c.onShutdown(c.bgClientCache.CloseAll) // clean up connections
c.onShutdown(c.putClientCache.CloseAll) // clean up connections
c.onShutdown(func() { _ = c.persistate.Close() })
return c

View file

@ -182,6 +182,14 @@ func initObjectService(c *cfg) {
basicConstructor: c.clientCache,
}
putConstructor := &coreClientConstructor{
log: c.log,
nmSrc: c.netMapSource,
netState: c.cfgNetmap.state,
trustStorage: c.cfgReputation.localTrustStorage,
basicConstructor: c.putClientCache,
}
var irFetcher v2.InnerRingFetcher
if c.cfgMorph.client.ProbeNotary() {
@ -255,7 +263,7 @@ func initObjectService(c *cfg) {
sPut := putsvc.NewService(
putsvc.WithKeyStorage(keyStorage),
putsvc.WithClientConstructor(coreConstructor),
putsvc.WithClientConstructor(putConstructor),
putsvc.WithMaxSizeSource(newCachedMaxObjectSizeSource(c)),
putsvc.WithObjectStorage(os),
putsvc.WithContainerSource(c.cfgObject.cnrSource),