fix(store): close pool on failed Ping; add ListEndpoints test
This commit is contained in:
@@ -16,6 +16,7 @@ func New(ctx context.Context, dsn string) (*Store, error) {
|
||||
return nil, err
|
||||
}
|
||||
if err := pool.Ping(ctx); err != nil {
|
||||
pool.Close()
|
||||
return nil, err
|
||||
}
|
||||
return &Store{Pool: pool}, nil
|
||||
|
||||
Reference in New Issue
Block a user