Skip to content

Commit

Permalink
调整:移除调度中心TaskGroupId
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Jan 8, 2024
1 parent 8699970 commit abc5428
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions traceManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (*traceManager) EntryTask(taskName string) trace.ITraceContext {
}

// EntryTaskGroup 创建本地任务入口(调度中心专用)
func (*traceManager) EntryTaskGroup(taskName string, taskGroupName string, taskGroupId int64, taskId int64) trace.ITraceContext {
func (*traceManager) EntryTaskGroup(taskName string, taskGroupName string, taskId int64) trace.ITraceContext {
traceId := parse.ToString(snowflake.GenerateId())
context := &TraceContext{
AppId: parse.ToString(core.AppId),
Expand All @@ -188,8 +188,8 @@ func (*traceManager) EntryTaskGroup(taskName string, taskGroupName string, taskG
StartTs: time.Now().UnixMicro(),
TraceType: eumTraceType.Task,
TaskContext: TaskContext{
TaskName: fmt.Sprintf("%s,任务组=(%v)%s,任务ID=%v", taskName, taskGroupId, taskGroupName, taskId),
TaskGroupId: taskGroupId,
TaskName: fmt.Sprintf("%s,任务组=%s,任务ID=%v", taskName, taskGroupName, taskId),
TaskGroupName: taskGroupName,
TaskId: taskId,
},
}
Expand All @@ -199,7 +199,7 @@ func (*traceManager) EntryTaskGroup(taskName string, taskGroupName string, taskG
}

// EntryFSchedule 创建调度中心入口
func (*traceManager) EntryFSchedule(taskGroupName string, taskGroupId int64, taskId int64) trace.ITraceContext {
func (*traceManager) EntryFSchedule(taskGroupName string, taskId int64) trace.ITraceContext {
traceId := parse.ToString(snowflake.GenerateId())
context := &TraceContext{
AppId: parse.ToString(core.AppId),
Expand All @@ -211,7 +211,7 @@ func (*traceManager) EntryFSchedule(taskGroupName string, taskGroupId int64, tas
TraceType: eumTraceType.FSchedule,
TaskContext: TaskContext{
TaskName: taskGroupName,
TaskGroupId: taskGroupId,
TaskGroupName: taskGroupName,
TaskId: taskId,
},
}
Expand Down
4 changes: 2 additions & 2 deletions trackContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ func (receiver ConsumerContext) IsNil() bool {

type TaskContext struct {
TaskName string // 任务名称
TaskGroupId int64 // 任务组ID
TaskGroupName string // 任务组ID
TaskId int64 // 任务ID
}

func (receiver TaskContext) IsNil() bool {
return receiver.TaskName == "" && receiver.TaskGroupId == 0 && receiver.TaskId == 0
return receiver.TaskName == "" && receiver.TaskGroupName == "" && receiver.TaskId == 0
}

type WatchKeyContext struct {
Expand Down

0 comments on commit abc5428

Please sign in to comment.