新增Stop接口,断开mongo连接

This commit is contained in:
boyce
2024-06-19 15:51:31 +08:00
parent 166facc959
commit f5e86fee02

View File

@@ -47,6 +47,10 @@ func (mm *MongoModule) Start() error {
return nil
}
func (mm *MongoModule) Stop() error {
return mm.client.Disconnect(context.Background())
}
func (mm *MongoModule) TakeSession() Session {
return Session{Client: mm.client, maxOperatorTimeOut: mm.maxOperatorTimeOut}
}