优化结构
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user