2
0

Remove unneeded goroutine spawn in connection pool destructor

fixes #708
This commit is contained in:
Jack Christensen
2020-04-02 21:51:12 -05:00
parent 43c2113f90
commit 0329f12e05
+3 -5
View File
@@ -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,
) )