# Conflicts: # go.mod # go.sum # internal/tools/cron_task.go # pkg/common/config/config.gopull/2393/head
commit
f315177a93
@ -1,2 +1,3 @@
|
|||||||
chatRecordsClearTime: "0 2 * * *"
|
cronExecuteTime: "0 2 * * *"
|
||||||
retainChatRecords: 365
|
retainChatRecords: 365
|
||||||
|
fileExpireTime: 90
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
package mgo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/model"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo/options"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Result[V any](val V, err error) V {
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
||||||
|
func Check(err error) {
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestName(t *testing.T) {
|
||||||
|
cli := Result(mongo.Connect(context.Background(), options.Client().ApplyURI("mongodb://openIM:openIM123@172.16.8.48:37017/openim_v3?maxPoolSize=100").SetConnectTimeout(5*time.Second)))
|
||||||
|
coll := cli.Database("openim_v3").Collection("version_test")
|
||||||
|
tmp, err := NewVersionLog(coll)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
vl := tmp.(*VersionLogMgo)
|
||||||
|
res, err := vl.writeLogBatch2(context.Background(), "100", []string{"1000", "1001", "1003"}, model.VersionStateInsert, time.Now())
|
||||||
|
if err != nil {
|
||||||
|
t.Log(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
t.Logf("%+v", res)
|
||||||
|
}
|
Loading…
Reference in new issue