mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 07:26:36 +08:00
autoresearch iter 22: delete lint suppressions that suppress nothing
24 of the 96 nolint directives were dead: they covered findings that no longer exist. A stale suppression is not inert — it silently claims any future finding for that linter in that scope, so a real problem raised there would vanish without anyone noticing. Explanatory prose was kept as ordinary comments. Two directives proved load-bearing under the project gate even though nolintlint reported them unused, and removing them exposed verified contextcheck false positives: App.Run does forward a sigCtx derived from the caller's context to Start, and the migration lock renewal must keep its own deadline because the task context may already be canceled. Both were restored, narrowed to the live linter, and given the reason the originals lacked.
This commit is contained in:
@@ -7,7 +7,7 @@ import "context"
|
||||
|
||||
// TaskResult 任务执行结果
|
||||
//
|
||||
//nolint:revive // TaskResult 保留完整名称以避免与通用 Result 混淆
|
||||
// TaskResult 保留完整名称以避免与通用 Result 混淆
|
||||
type TaskResult struct {
|
||||
Message string // 结果摘要,如 "共清理 120 个文件,耗时 3.2s"
|
||||
Detail string // 可选的详细结果 JSON
|
||||
@@ -26,7 +26,7 @@ type PayloadValidator interface {
|
||||
// 开发者只需实现 Execute 方法编写业务逻辑,在方法内通过 driver_asynq_worker.AppendLog(ctx, ...) 追加执行日志。
|
||||
// 任务的创建、状态更新、错误记录、重试计数全部由框架透明处理。
|
||||
//
|
||||
//nolint:revive // TaskHandler 保留完整名称以避免与通用 Handler 混淆
|
||||
// TaskHandler 保留完整名称以避免与通用 Handler 混淆
|
||||
type TaskHandler interface {
|
||||
// Execute 执行任务业务逻辑
|
||||
// - ctx: 已注入 Trace Span 和 taskID 的上下文
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
// TaskParam 任务参数定义
|
||||
//
|
||||
//nolint:revive // TaskParam 保留完整名称以避免与通用 Param 混淆
|
||||
// TaskParam 保留完整名称以避免与通用 Param 混淆
|
||||
type TaskParam struct {
|
||||
Name string `json:"name"` // 参数键名
|
||||
Label string `json:"label"` // 显示名称
|
||||
@@ -22,7 +22,7 @@ type TaskParam struct {
|
||||
|
||||
// TaskMeta 任务元数据
|
||||
//
|
||||
//nolint:revive // TaskMeta 保留完整名称以避免与通用 Meta 混淆
|
||||
// TaskMeta 保留完整名称以避免与通用 Meta 混淆
|
||||
type TaskMeta struct {
|
||||
Type string `json:"type"`
|
||||
AsynqTask string `json:"asynq_task"`
|
||||
|
||||
@@ -12,8 +12,6 @@ import (
|
||||
)
|
||||
|
||||
// TaskExecutionStatus 任务执行状态
|
||||
//
|
||||
//nolint:revive
|
||||
type TaskExecutionStatus string
|
||||
|
||||
// Task execution status constants.
|
||||
@@ -25,8 +23,6 @@ const (
|
||||
)
|
||||
|
||||
// TaskExecution 任务执行记录
|
||||
//
|
||||
//nolint:revive
|
||||
type TaskExecution struct {
|
||||
ID uint64 `json:"id,string" gorm:"primaryKey"`
|
||||
TaskID string `json:"task_id" gorm:"size:128;uniqueIndex;not null"`
|
||||
@@ -92,8 +88,6 @@ func GetLatestTaskExecutionByTaskType(ctx context.Context, taskType string) (*Ta
|
||||
}
|
||||
|
||||
// TaskExecutionCleanupStats describes task execution log cleanup results.
|
||||
//
|
||||
//nolint:revive
|
||||
type TaskExecutionCleanupStats struct {
|
||||
HighFrequencyDeleted int64
|
||||
LowFrequencyDeleted int64
|
||||
|
||||
Reference in New Issue
Block a user