mirror of
https://github.com/go-micro/go-micro.git
synced 2025-11-29 21:47:44 +02:00
fix: "Solve the problem that the resources have not been fully released due to early exit" (#2168)
* Update http.go Exit before deregister is executed * Create http.go Exit before deregister is executed * Solve the problem that the resources have not been fully released due to early exit * Optimize some code * Optimize some code
This commit is contained in:
@@ -13,13 +13,13 @@ type registrySelector struct {
|
||||
}
|
||||
|
||||
func (c *registrySelector) newCache() cache.Cache {
|
||||
ropts := []cache.Option{}
|
||||
opts := make([]cache.Option, 0, 1)
|
||||
if c.so.Context != nil {
|
||||
if t, ok := c.so.Context.Value("selector_ttl").(time.Duration); ok {
|
||||
ropts = append(ropts, cache.WithTTL(t))
|
||||
opts = append(opts, cache.WithTTL(t))
|
||||
}
|
||||
}
|
||||
return cache.New(c.so.Registry, ropts...)
|
||||
return cache.New(c.so.Registry, opts...)
|
||||
}
|
||||
|
||||
func (c *registrySelector) Init(opts ...Option) error {
|
||||
|
||||
Reference in New Issue
Block a user