diff --git a/dbs/mongo/mongo.go b/dbs/mongo/mongo.go index e8644c2..48c946a 100644 --- a/dbs/mongo/mongo.go +++ b/dbs/mongo/mongo.go @@ -219,7 +219,7 @@ func (m *MongoDB) UpdateMultiple(set interface{}, filter map[string]interface{}, f = append(f, bson.E{Key: k, Value: v}) } targetDBCollection := CollectionMap[collection_name] - MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + MngoCtx, cancel = context.WithTimeout(context.Background(), 50*time.Second) defer cancel() res, err := targetDBCollection.UpdateMany(MngoCtx, f, dbs.InputToBson(doc, true)) if err != nil { @@ -238,7 +238,7 @@ func (m *MongoDB) UpdateOne(set interface{}, id string, collection_name string) bson.Unmarshal(b, &doc) filter := bson.M{"_id": id} targetDBCollection := CollectionMap[collection_name] - MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + MngoCtx, cancel = context.WithTimeout(context.Background(), 50*time.Second) defer cancel() _, err := targetDBCollection.UpdateOne(MngoCtx, filter, dbs.InputToBson(doc, true)) if err != nil {