v0.0.476 Ãproperly close cursor in wmo
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m44s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m44s
This commit is contained in:
@@ -69,6 +69,8 @@ func (c *Coll[TData]) List(ctx context.Context, filter ct.Filter, pageSize *int,
|
||||
return nil, ct.CursorToken{}, exerr.Wrap(err, "mongo-aggregation failed").Any("pipeline", pipeline).Str("collection", c.Name()).Build()
|
||||
}
|
||||
|
||||
defer func() { _ = cursor.Close(ctx) }()
|
||||
|
||||
// fast branch
|
||||
if pageSize == nil {
|
||||
entries, err := c.decodeAll(ctx, cursor)
|
||||
@@ -118,6 +120,8 @@ func (c *Coll[TData]) Count(ctx context.Context, filter ct.RawFilter) (int64, er
|
||||
return 0, exerr.Wrap(err, "mongo-aggregation failed").Any("pipeline", pipeline).Str("collection", c.Name()).Build()
|
||||
}
|
||||
|
||||
defer func() { _ = cursor.Close(ctx) }()
|
||||
|
||||
if cursor.Next(ctx) {
|
||||
v := countRes{}
|
||||
err = cursor.Decode(&v)
|
||||
|
Reference in New Issue
Block a user