优化结构

This commit is contained in:
Yvan
2026-08-28 15:07:16 +08:00
parent ae5345de14
commit a4ed3a02df
15 changed files with 92 additions and 60 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ func (r *mediaRepo) DeleteChunks(ctx context.Context, uploadID uint) error {
}
func (r *mediaRepo) StaleUploadSessionIDs(ctx context.Context, before time.Time) ([]uint, error) {
var ids []uint
err := r.data.DB().WithContext(ctx).Model(&uploadSessionPO{}).Where("status = ? AND updated_at < ?", "uploading", before).Pluck("id", &ids).Error
err := r.data.DB().WithContext(ctx).Model(&uploadSessionPO{}).Where("status IN ? AND updated_at < ?", []string{"uploading", "failed", "merging"}, before).Pluck("id", &ids).Error
return ids, err
}
func (r *mediaRepo) DeleteUploadData(ctx context.Context, uploadID uint) error {