写错了

This commit is contained in:
Jerry Yan 2025-04-13 12:00:24 +08:00
parent 91bb5e4e5a
commit b11a315b0d
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ import (
var tracer = otel.Tracer("task")
func HandleTask(ctx context.Context, device config.DeviceMapping, task dto.Task) (*dto.FileObject, error) {
subCtx, span := tracer.Start(ctx, "startTask")
subCtx, span := tracer.Start(ctx, "HandleTask")
defer span.End()
adapter := fs.GetAdapter()
span.SetAttributes(attribute.String("taskId", task.TaskID))

View File

@ -42,7 +42,7 @@ func startTask(device config.DeviceMapping, task dto.Task) {
return
}
result := api.ReportTaskSuccess(ctx, task.TaskID, fo)
if result {
if !result {
span.SetStatus(codes.Error, "上报任务成功失败")
log.Printf("上报任务成功失败, TaskID【%s】, DeviceNo: %s, 错误: %v\n", task.TaskID, task.DeviceNo, err)
return