Browse Source

关闭mongo日志

xyxie 10 months ago
parent
commit
18c39853f1
1 changed files with 2 additions and 6 deletions
  1. 2 6
      utils/mgodb/mgo_config.go

+ 2 - 6
utils/mgodb/mgo_config.go

@@ -2,14 +2,10 @@ package mgodb
 
 import (
 	"context"
-	"eta/eta_forum_hub/utils"
 	"fmt"
-	"go.mongodb.org/mongo-driver/bson"
-	"go.mongodb.org/mongo-driver/event"
 	"go.mongodb.org/mongo-driver/mongo"
 	"go.mongodb.org/mongo-driver/mongo/options"
 	"go.mongodb.org/mongo-driver/mongo/readpref"
-	"sync"
 	"time"
 )
 
@@ -42,7 +38,7 @@ func NewMgoClient(mgoConfig MgoConfig) *mongo.Client {
 		Password:      mgoConfig.Password,
 	}
 	clientOpts := options.Client().ApplyURI(mgoConfig.Url).SetAuth(credential)
-	startedCommands := sync.Map{} // map[int64]bson.Raw
+	/*startedCommands := sync.Map{} // map[int64]bson.Raw
 
 	cmdMonitor := &event.CommandMonitor{
 		Started: func(_ context.Context, evt *event.CommandStartedEvent) {
@@ -77,7 +73,7 @@ func NewMgoClient(mgoConfig MgoConfig) *mongo.Client {
 
 	// 创建options
 
-	clientOpts.SetMonitor(cmdMonitor)
+	clientOpts.SetMonitor(cmdMonitor)*/
 
 	clientOpts.SetMinPoolSize(MinPoolSize)
 	clientOpts.SetMaxPoolSize(MaxPoolSize)