mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
新增Stop接口,断开mongo连接
This commit is contained in:
@@ -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}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user