-
Notifications
You must be signed in to change notification settings - Fork 23
Refactor UploadHandler and add ResumeUpload #166
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
Conversation
…ume upload support
…added scripts and docker-compose.yml for dev
…ations on connectionObj.Save;updated uploadFormData;
…or instead of docker
|
@Sriep please help me to review PR if you get some time left , thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newly written functions need unit tests.
@@ -0,0 +1,2 @@ | |||
blobber |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove.
Any scripts for building blobber should not use go source directories for executables please put them somewhere else.
If its just your own private build for debugging, then you should keep them private and not push to the main repository.
@@ -31,6 +34,7 @@ const ( | |||
|
|||
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
155 characters is quite long, maybe you could split the line.
IsFinal bool `json:"is_final,omitempty"` | ||
//client side: unmarshal them from 'updateMeta'/'uploadMeta' | ||
ConnectionID string `json:"connection_id" validation:"required"` | ||
//client side: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This style is confusing to read. I suggest grouping the members under one ///client side
comment.
@@ -532,6 +534,8 @@ func (fsh *StorageHandler) CommitWrite(ctx context.Context, r *http.Request) (*C | |||
if err != nil { | |||
return nil, err | |||
} | |||
|
|||
fmt.Println(rootRef.Hash + ":" + strconv.FormatInt(int64(writeMarker.Timestamp), 10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using fmt.Println
rather than a logger? If it is just a debug line please remove it.
ignore it first. thanks. |
Checklist:
InsertFileCommand
,UpdateFileCommand
andDeleteFileCommand
for flexible stylePATCH
handler as ResumeUpload requestResumeFileCommand
to process ResumeUpload requestResumeFileChange
for file transactionStreamMerkleHasher
as stateful merkle tree to compute streaming fileWriteChunk
inFileFSStore
to flush chunk to temp file.Refs: