Remove unneeded goroutine spawn in connection pool destructor

fixes #708
pull/709/head
Jack Christensen 2020-04-02 21:51:12 -05:00
parent 43c2113f90
commit 0329f12e05
1 changed files with 3 additions and 5 deletions

View File

@ -171,11 +171,9 @@ func ConnectConfig(ctx context.Context, config *Config) (*Pool, error) {
return cr, nil
},
func(value interface{}) {
go func() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
value.(*connResource).conn.Close(ctx)
cancel()
}()
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
value.(*connResource).conn.Close(ctx)
cancel()
},
config.MaxConns,
)