refactor(cleaner): 移除未使用的存储删除接口

清理任务时不再调用 Storage.DeleteByTask 方法,因为当前 OSS 服务暂未提供删除接口。
从 StorageService 接口和 ossStorage 实现中移除 DeleteByTask 方法,并更新清理逻辑。
This commit is contained in:
2026-04-23 15:02:24 +08:00
parent 9de47fa5b8
commit 23b83cae39
3 changed files with 1 additions and 11 deletions

View File

@@ -45,7 +45,6 @@ func (c *cleaner) runOnce(ctx context.Context) {
g.Log().Errorf(ctx, "[cleaner] list expired(downloaded) error: %v", err)
} else {
for _, t := range expired {
_ = Storage.DeleteByTask(ctx, t)
_ = dao.Task.HardDeleteByIDGlobal(ctx, t.Id)
}
g.Log().Infof(ctx, "[cleaner] expired(downloaded) cleaned, count=%d", len(expired))
@@ -77,13 +76,12 @@ func (c *cleaner) runOnce(ctx context.Context) {
g.Log().Infof(ctx, "[cleaner] failed retryable cleaned, count=%d", len(retryable))
}
// 4) 超过重试次数仍失败(state=3)的任务:硬删除 + OSS
// 4) 超过重试次数仍失败(state=3)的任务:硬删除
exhausted, err := dao.Task.ListFailedExhaustedGlobal(ctx, 200)
if err != nil {
g.Log().Errorf(ctx, "[cleaner] list failed exhausted error: %v", err)
} else {
for _, t := range exhausted {
_ = Storage.DeleteByTask(ctx, t)
_ = dao.Task.HardDeleteByIDGlobal(ctx, t.Id)
}
g.Log().Infof(ctx, "[cleaner] failed exhausted cleaned, count=%d", len(exhausted))