mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
mongodb: ensure closing cursor
This commit is contained in:
parent
aa7fc299b8
commit
98cce6a150
|
@ -199,9 +199,13 @@ func (store *MongodbStore) ListDirectoryEntries(ctx context.Context, dirPath uti
|
||||||
|
|
||||||
for cur.Next(ctx) {
|
for cur.Next(ctx) {
|
||||||
var data Model
|
var data Model
|
||||||
err := cur.Decode(&data)
|
err = cur.Decode(&data)
|
||||||
if err != nil && err != mongo.ErrNoDocuments {
|
if err == mongo.ErrNoDocuments {
|
||||||
return lastFileName, err
|
err = nil
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
entry := &filer.Entry{
|
entry := &filer.Entry{
|
||||||
|
|
Loading…
Reference in a new issue