Added read status to obj

Signed-off-by: m.malygina <m.malygina@yadro.com>
add-delete-after-read
m.malygina 2024-06-05 17:25:30 +03:00
parent b1a315ea5b
commit 034e319809
1 changed files with 1 additions and 2 deletions

View File

@ -3,7 +3,6 @@ package registry
import (
"context"
"encoding/binary"
"errors"
"fmt"
"os"
"time"
@ -84,7 +83,7 @@ func (o *ObjRegistry) SetObjectStatus(id uint64, oldStatus, newStatus string) er
key := encodeId(id)
objBytes := oldB.Get(key)
if objBytes == nil {
return errors.New("object doesn't exist")
return fmt.Errorf("object %w doesn't exist", key)
}
if err := oldB.Delete(key); err != nil {
return fmt.Errorf("bucket.Delete: %w", err)