MCPcopy Create free account
hub / github.com/Cyinx/einx / Start

Method Start

db/mongodb/mongodb.go:47–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45}
46
47func (this *MongoDBMgr) Start() {
48 var err error
49 this.session, err = mgo.DialWithTimeout(this.dbcfg.String(), this.timeout)
50 if err != nil {
51 e := &event.ComponentEventMsg{}
52 e.MsgType = event.EVENT_COMPONENT_ERROR
53 e.Sender = this
54 e.Attach = err
55 this.m.PushEventMsg(e)
56 return
57 }
58
59 this.session.SetMode(mgo.Monotonic, true)
60 slog.LogInfo("mongodb", "MongoDB Connect success")
61}
62
63func (this *MongoDBMgr) Close() {
64 if this.session != nil {

Callers

nothing calls this directly

Calls 3

SetModeMethod · 0.80
PushEventMsgMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected