Remove unneeded goroutine spawn in connection pool destructor
fixes #708
This commit is contained in:
+3
-5
@@ -171,11 +171,9 @@ func ConnectConfig(ctx context.Context, config *Config) (*Pool, error) {
|
|||||||
return cr, nil
|
return cr, nil
|
||||||
},
|
},
|
||||||
func(value interface{}) {
|
func(value interface{}) {
|
||||||
go func() {
|
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
value.(*connResource).conn.Close(ctx)
|
||||||
value.(*connResource).conn.Close(ctx)
|
cancel()
|
||||||
cancel()
|
|
||||||
}()
|
|
||||||
},
|
},
|
||||||
config.MaxConns,
|
config.MaxConns,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user