refactoring scheduled tasks

This commit is contained in:
withchao
2024-12-19 11:28:49 +08:00
parent f03cbec653
commit 705bc37f99
9 changed files with 180 additions and 147 deletions
+3 -3
View File
@@ -12,9 +12,9 @@ import (
func (c *cronServer) clearUserMsg() {
now := time.Now()
ctx := mcontext.SetOperationID(c.ctx, fmt.Sprintf("cron_%d_%d", os.Getpid(), now.UnixMilli()))
log.ZDebug(ctx, "clear msg cron start", "now", now)
operationID := fmt.Sprintf("cron_user_msg_%d_%d", os.Getpid(), now.UnixMilli())
ctx := mcontext.SetOperationID(c.ctx, operationID)
log.ZDebug(ctx, "clear msg cron start")
conversations, err := c.conversationClient.GetConversationsNeedClearMsg(ctx, &pbconversation.GetConversationsNeedClearMsgReq{})
if err != nil {
log.ZError(ctx, "Get conversation need Destruct msgs failed.", err)