暂存
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m32s

This commit is contained in:
2026-08-06 09:35:00 +08:00
parent 8659dfc658
commit 88cc5e96ec
75 changed files with 6520 additions and 513 deletions

View File

@@ -1,14 +1,29 @@
package task
import (
"context"
"strconv"
"time"
"github.com/bytedance/sonic"
"go.uber.org/zap"
"gorm.io/gorm"
"github.com/break/junhong_cmp_fiber/pkg/auditcontext"
"github.com/break/junhong_cmp_fiber/pkg/constants"
)
// withPollingWorkerAuditContext 为实际改变业务事实的轮询任务补充真实系统操作者与链路。
func withPollingWorkerAuditContext(ctx context.Context, taskType, taskName, correlationID string) context.Context {
if correlationID == "" {
correlationID = taskType
}
return auditcontext.With(ctx, auditcontext.Context{
ActorKind: constants.AuditActorSystemTask, ActorID: taskType,
ActorName: taskName, Source: constants.AuditSourceWorker, CorrelationID: correlationID,
})
}
// shortTaskType 从完整任务类型中提取简短名称(如 polling:carddata → carddata
func shortTaskType(fullTaskType string) string {
for i := len(fullTaskType) - 1; i >= 0; i-- {