mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-04 23:16:37 +08:00
refactor: eliminate string/magic-number literals (goconst, mnd) and fix const-type grouping (SA9004)
- upload/task: taskCategoryUpload/taskQueueDefault 常量替代 8 处字面量 - admin: 复用既有 logDBNameSQLite 常量替代 3 处 "sqlite" 字面量 - pkg/cache/disk: defaultCleanupInterval 命名常量 - driver_asynq_worker/executor: 分离 contextKey 类型常量组 lint_issues 45→34, tests 44/44
This commit is contained in:
@@ -17,6 +17,12 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
// 上传域任务的通用元数据常量(TaskMetaDTO Category/Queue 复用)
|
||||
const (
|
||||
taskCategoryUpload = "upload"
|
||||
taskQueueDefault = "default"
|
||||
)
|
||||
|
||||
const (
|
||||
// WarmImageCacheTask 图片压缩缓存预热任务标识
|
||||
WarmImageCacheTask = "upload:warm_image_cache"
|
||||
@@ -31,9 +37,9 @@ var WarmImageCacheMeta = contracts.TaskMetaDTO{
|
||||
Name: WarmImageCacheTask,
|
||||
DisplayName: "预热图片压缩缓存",
|
||||
Description: "串行将文件管理中的图片转换为指定质量的 WebP 并写入永久缓存",
|
||||
Category: "upload",
|
||||
Category: taskCategoryUpload,
|
||||
MaxRetry: 3,
|
||||
Queue: "default",
|
||||
Queue: taskQueueDefault,
|
||||
Params: []contracts.TaskParamDTO{
|
||||
{
|
||||
Name: "quality",
|
||||
|
||||
Reference in New Issue
Block a user