Browse Source

增加ec读、调

gitlink
zkxx 2 years ago
parent
commit
8fc823b743
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      internal/services/storage.go

+ 2
- 1
internal/services/storage.go View File

@@ -61,7 +61,7 @@ func (svc *Service) PreMoveObjectToStorage(msg *coormsg.PreMoveObjectToStorage)
return ramsg.ReplyOK(coormsg.NewPreMoveObjectToStorageRespBody( return ramsg.ReplyOK(coormsg.NewPreMoveObjectToStorageRespBody(
stg.NodeID, stg.NodeID,
stg.Directory, stg.Directory,
object.FileSize,
object,
models.NewRedundancyRepData(objectRep.FileHash), models.NewRedundancyRepData(objectRep.FileHash),
)) ))


@@ -132,6 +132,7 @@ func (svc *Service) PreMoveObjectToStorage(msg *coormsg.PreMoveObjectToStorage)
} }


func (svc *Service) MoveObjectToStorage(msg *coormsg.MoveObjectToStorage) (*coormsg.MoveObjectToStorageResp, *ramsg.CodeMessage) { func (svc *Service) MoveObjectToStorage(msg *coormsg.MoveObjectToStorage) (*coormsg.MoveObjectToStorageResp, *ramsg.CodeMessage) {
// TODO: 对于的storage中已经存在的文件,直接覆盖已有文件
err := svc.db.DoTx(sql.LevelDefault, func(tx *sqlx.Tx) error { err := svc.db.DoTx(sql.LevelDefault, func(tx *sqlx.Tx) error {
return svc.db.StorageObject().MoveObjectTo(tx, msg.ObjectID, msg.StorageID, msg.UserID) return svc.db.StorageObject().MoveObjectTo(tx, msg.ObjectID, msg.StorageID, msg.UserID)
}) })


Loading…
Cancel
Save