mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-21 20:32:32 +08:00
exception handling
This commit is contained in:
parent
90cde99f06
commit
2b9a3536e7
@ -147,7 +147,12 @@ func (d *DataBases) SaveUserChat(uid string, sendTime int64, m proto.Message) er
|
||||
if session == nil {
|
||||
return errors.New("session == nil")
|
||||
}
|
||||
defer session.Close()
|
||||
defer func() {
|
||||
if session != nil {
|
||||
session.Close()
|
||||
}
|
||||
}()
|
||||
|
||||
log.NewInfo("", "get mgoSession cost time", getCurrentTimestampByMill()-newTime)
|
||||
c := session.DB(config.Config.Mongo.DBDatabase).C(cChat)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user