mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 23:26:38 +08:00
chore(lint): unify formatting on golangci-lint fmt (gofumpt), uncap issue reporting, fix gofumpt drift
- make format 现在与 code-check 使用同一格式化器(golangci-lint fmt),消除 goimports -local 与 gofumpt 的格式拉锯 - .golangci.yml 关闭默认 50/3 截断,完整上报所有问题(只增强不弱化) - 全库 gofumpt 规范化(203 files, 纯格式无行为变更)
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
package driver_asynq_worker
|
||||
|
||||
import (
|
||||
"Wavelet/pkg/idgen"
|
||||
"Wavelet/pkg/logger"
|
||||
"Wavelet/pkg/util"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
@@ -18,10 +21,7 @@ import (
|
||||
"go.opentelemetry.io/otel/propagation"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
||||
"Wavelet/pkg/idgen"
|
||||
"Wavelet/pkg/logger"
|
||||
otel_trace "Wavelet/pkg/trace"
|
||||
"Wavelet/pkg/util"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -76,8 +76,10 @@ func ValidateAndNormalizePayload(asynqTaskType string, payload []byte) ([]byte,
|
||||
// contextKey 用于 context 存取 taskID
|
||||
type contextKey string
|
||||
|
||||
const taskIDKey contextKey = "task_execution_task_id"
|
||||
const traceEnvelopeVersion = 1
|
||||
const (
|
||||
taskIDKey contextKey = "task_execution_task_id"
|
||||
traceEnvelopeVersion = 1
|
||||
)
|
||||
|
||||
type traceEnvelope struct {
|
||||
WaveletTraceEnvelope bool `json:"_wavelet_trace_envelope"`
|
||||
@@ -489,7 +491,7 @@ func handleSuccessfulTask(ctx context.Context, execution *TaskExecution, t *asyn
|
||||
}
|
||||
|
||||
// generateTaskID 生成任务 ID
|
||||
func generateTaskID(taskType string, triggeredBy string) string {
|
||||
func generateTaskID(taskType, triggeredBy string) string {
|
||||
return fmt.Sprintf("%s_%s_%d", triggeredBy, taskType, idgen.NextUint64ID())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user