Infinite loop debug

This commit is contained in:
mr
2026-03-23 09:03:07 +01:00
parent ea2a98d84a
commit 5bdd2554a7
2 changed files with 13 additions and 2 deletions

View File

@@ -267,6 +267,9 @@ func (m *MongoDB) LoadOne(id string, collection_name string) (*mongo.SingleResul
}
filter := bson.M{"_id": id}
targetDBCollection := CollectionMap[collection_name]
if targetDBCollection == nil {
return nil, 503, errors.New("collection " + collection_name + " not initialized")
}
MngoCtx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
//defer cancel()
@@ -286,6 +289,9 @@ func (m *MongoDB) Search(filters *dbs.Filters, collection_name string) (*mongo.C
opts := options.Find()
opts.SetLimit(1000)
targetDBCollection := CollectionMap[collection_name]
if targetDBCollection == nil {
return nil, 503, errors.New("collection " + collection_name + " not initialized")
}
f := dbs.GetBson(filters)