Added read status to obj

Signed-off-by: m.malygina <m.malygina@yadro.com>
This commit is contained in:
m.malygina 2024-06-05 17:25:30 +03:00
parent b1a315ea5b
commit 034e319809

View file

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