Skip to content

Commit

Permalink
Encode uuid in cursor storage instead of byte slice
Browse files Browse the repository at this point in the history
  • Loading branch information
mofirouz committed Oct 3, 2018
1 parent df46554 commit b2df2c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/core_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"fmt"

"context"

"github.com/cockroachdb/cockroach-go/crdb"
"github.com/gofrs/uuid"
"github.com/golang/protobuf/ptypes/timestamp"
Expand All @@ -34,7 +35,7 @@ import (

type storageCursor struct {
Key string
UserID []byte
UserID uuid.UUID
Read int32
}

Expand Down Expand Up @@ -286,7 +287,7 @@ func storageListObjects(rows *sql.Rows, cursor string) (*api.StorageObjectList,
}

if lastObject.UserId != "" {
newCursor.UserID = uuid.FromStringOrNil(lastObject.UserId).Bytes()
newCursor.UserID = uuid.FromStringOrNil(lastObject.UserId)
}

cursorBuf := new(bytes.Buffer)
Expand Down

0 comments on commit b2df2c0

Please sign in to comment.