Skip to content

Commit

Permalink
Feat/partial delete suppport (#626)
Browse files Browse the repository at this point in the history
* fix(objecttree):fixed status code with 404

* fix(filechange):removed unused error

* fix(devops): fixed checkout action issue
  • Loading branch information
cnlangzi committed Apr 9, 2022
1 parent 48b95da commit d2c3392
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/config_change_alert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
test:
runs-on: docker-builds
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v1
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.

Expand Down
3 changes: 0 additions & 3 deletions code/go/0chain.net/blobbercore/allocation/allocationchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
"github.com/0chain/blobber/code/go/0chain.net/core/common"
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
"github.com/0chain/gosdk/constants"

Expand All @@ -21,8 +20,6 @@ const (
DeletedConnection = 3
)

var OperationNotApplicable = common.NewError("operation_not_valid", "Not an applicable operation")

// AllocationChangeProcessor request transaction of file operation. it is president in postgres, and can be rebuilt for next http reqeust(eg CommitHandler)
type AllocationChangeProcessor interface {
CommitToFileStore(ctx context.Context) error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (ac *AttributesChange) Unmarshal(val string) (err error) {

// The DeleteTempFile returns OperationNotApplicable error.
func (ac *AttributesChange) DeleteTempFile() (err error) {
return OperationNotApplicable
return nil
}

// The CommitToFileStore does nothing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (nf *DeleteFileChange) Unmarshal(input string) error {
}

func (nf *DeleteFileChange) DeleteTempFile() error {
return OperationNotApplicable
return nil
}

func (nf *DeleteFileChange) CommitToFileStore(ctx context.Context) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type RenameFileChange struct {
}

func (rf *RenameFileChange) DeleteTempFile() error {
return OperationNotApplicable
return nil
}

func (rf *RenameFileChange) ApplyChange(ctx context.Context, change *AllocationChange, allocationRoot string) (*reference.Ref, error) {
Expand Down
2 changes: 1 addition & 1 deletion code/go/0chain.net/blobbercore/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func ObjectTreeHandler(ctx context.Context, r *http.Request) (interface{}, int,
response, err := storageHandler.GetObjectTree(ctx, r)
if err != nil {
if errors.Is(common.ErrNotFound, err) {
return response, http.StatusNoContent, nil
return response, http.StatusNotFound, nil
}
return nil, http.StatusBadRequest, err
}
Expand Down

0 comments on commit d2c3392

Please sign in to comment.