Skip to content

Commit faac37c

Browse files
committed
use exec
1 parent 25d9a38 commit faac37c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,8 +1260,9 @@ func (fsh *StorageHandler) CreateDir(ctx context.Context, r *http.Request) (*all
12601260
if exisitingRef != nil {
12611261
// target directory exists, return StatusOK
12621262
if exisitingRef.Type == reference.DIRECTORY {
1263+
12631264
if exisitingRef.CustomMeta != customMeta {
1264-
logging.Logger.Info("Updating custom meta", zap.String("path", exisitingRef.Path))
1265+
logging.Logger.Info("Updating custom meta", zap.Int64("id", exisitingRef.ID))
12651266
_ = datastore.GetStore().WithNewTransaction(func(ctx context.Context) error {
12661267
err := reference.UpdateCustomMeta(ctx, exisitingRef, customMeta)
12671268
if err != nil {

code/go/0chain.net/blobbercore/reference/ref.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,5 +672,5 @@ func GetListingFieldsMap(refEntity interface{}, tagName string) map[string]inter
672672

673673
func UpdateCustomMeta(ctx context.Context, ref *Ref, customMeta string) error {
674674
db := datastore.GetStore().GetTransaction(ctx)
675-
return db.Model(ref).Update("custom_meta", customMeta).Error
675+
return db.Exec("UPDATE reference_objects SET custom_meta = ? WHERE id = ?", customMeta, ref.ID).Error
676676
}

0 commit comments

Comments
 (0)