Skip to content

Commit 824bee7

Browse files
committed
check dup key
1 parent 3c17782 commit 824bee7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

code/go/0chain.net/blobbercore/handler/file_command_delete.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ func (cmd *DeleteFileCommand) IsValidated(ctx context.Context, req *http.Request
6363

6464
// UpdateChange add DeleteFileChange in db
6565
func (cmd *DeleteFileCommand) UpdateChange(ctx context.Context, connectionObj *allocation.AllocationChangeCollector) error {
66-
return cmd.AddChange(ctx)
66+
err := cmd.AddChange(ctx)
67+
if err == gorm.ErrDuplicatedKey {
68+
return nil
69+
}
70+
return err
6771
}
6872

6973
func (cmd *DeleteFileCommand) AddChange(ctx context.Context) error {

0 commit comments

Comments
 (0)