mirror of
https://github.com/duanhf2012/origin.git
synced 2026-03-02 11:21:11 +08:00
新增Stop接口,断开mongo连接
This commit is contained in:
@@ -47,6 +47,10 @@ func (mm *MongoModule) Start() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (mm *MongoModule) Stop() error {
|
||||||
|
return mm.client.Disconnect(context.Background())
|
||||||
|
}
|
||||||
|
|
||||||
func (mm *MongoModule) TakeSession() Session {
|
func (mm *MongoModule) TakeSession() Session {
|
||||||
return Session{Client: mm.client, maxOperatorTimeOut: mm.maxOperatorTimeOut}
|
return Session{Client: mm.client, maxOperatorTimeOut: mm.maxOperatorTimeOut}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user