chore: mark as removed instead of delete history

This commit is contained in:
Simon Ding
2025-03-31 17:59:04 +08:00
parent c23666eabf
commit 3c9f6d0b23
6 changed files with 18 additions and 4 deletions

View File

@@ -83,6 +83,7 @@ const (
StatusFail Status = "fail"
StatusUploading Status = "uploading"
StatusSeeding Status = "seeding"
StatusRemoved Status = "removed"
)
func (s Status) String() string {
@@ -92,7 +93,7 @@ func (s Status) String() string {
// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.
func StatusValidator(s Status) error {
switch s {
case StatusRunning, StatusSuccess, StatusFail, StatusUploading, StatusSeeding:
case StatusRunning, StatusSuccess, StatusFail, StatusUploading, StatusSeeding, StatusRemoved:
return nil
default:
return fmt.Errorf("history: invalid enum value for status field: %q", s)