session copy

This commit is contained in:
Sebastian Frank 2022-02-09 15:24:44 +01:00
parent 100eb29007
commit 702a05f405
Signed by: apairon
GPG Key ID: A0E05A8199CE3F57

View File

@ -14,6 +14,10 @@ func (s *Session) Close() {
s.session.Close() s.session.Close()
} }
func (s *Session) Copy() *Session {
return &Session{session: s.session.Copy()}
}
func NewSession(dial string) (*Session, error) { func NewSession(dial string) (*Session, error) {
session, err := mgo.Dial(dial) session, err := mgo.Dial(dial)
if err != nil { if err != nil {