Skip to content

Feat/partial delete suppport #626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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