mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-12 21:16:00 +08:00
test cron
This commit is contained in:
@@ -79,7 +79,7 @@ func deleteMongoMsg(operationID string, ID string, index int64, delMsgIDList *[]
|
||||
if err != nil || msgs.UID == "" {
|
||||
if err != nil {
|
||||
if err == db.ErrMsgListNotExist {
|
||||
log.NewDebug(operationID, utils.GetSelfFuncName(), ID, index, err.Error())
|
||||
log.NewDebug(operationID, utils.GetSelfFuncName(), "ID:", ID, "index:", index, err.Error())
|
||||
} else {
|
||||
log.NewError(operationID, utils.GetSelfFuncName(), "GetUserMsgListByIndex failed", err.Error(), index, ID)
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ const cronTaskOperationID = "cronTaskOperationID-"
|
||||
|
||||
func StartCronTask() {
|
||||
log.NewPrivateLog("cron")
|
||||
log.NewInfo(utils.OperationIDGenerator(), "start cron task")
|
||||
log.NewInfo(utils.OperationIDGenerator(), "start cron task", "cron config", config.Config.Mongo.ChatRecordsClearTime)
|
||||
c := cron.New()
|
||||
fmt.Println("config", config.Config.Mongo.ChatRecordsClearTime)
|
||||
fmt.Println("cron config", config.Config.Mongo.ChatRecordsClearTime)
|
||||
_, err := c.AddFunc(config.Config.Mongo.ChatRecordsClearTime, func() {
|
||||
// user msg clear
|
||||
operationID := getCronTaskOperationID()
|
||||
|
||||
Reference in New Issue
Block a user