Merge pull request #6 from Selly-Modules/add-monitor

add monitor options
This commit is contained in:
luuvansinh 2022-03-14 10:34:05 +07:00 committed by GitHub
commit 1daf5b3f1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -56,6 +56,9 @@ func Connect(cfg Config) (*mongo.Database, error) {
Password: opts.Password, Password: opts.Password,
} }
} }
if cfg.Monitor != nil {
connectOptions.SetMonitor(cfg.Monitor)
}
// Connect // Connect
client, err := mongo.Connect(context.Background(), connectOptions.ApplyURI(cfg.Host)) client, err := mongo.Connect(context.Background(), connectOptions.ApplyURI(cfg.Host))