mirror of
https://github.com/logos-storage/logos-storage-go-bindings.git
synced 2026-01-04 06:23:06 +00:00
Defer UploadCancel after UploadInit to be sure that the upload is cancelled after the function is done
This commit is contained in:
parent
d2d8802245
commit
24789fb855
@ -171,6 +171,7 @@ func (node CodexNode) UploadReader(ctx context.Context, options UploadOptions, r
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
defer node.UploadCancel(sessionId)
|
||||||
|
|
||||||
buf := make([]byte, options.ChunkSize.valOrDefault())
|
buf := make([]byte, options.ChunkSize.valOrDefault())
|
||||||
total := 0
|
total := 0
|
||||||
@ -297,6 +298,7 @@ func (node CodexNode) UploadFile(ctx context.Context, options UploadOptions) (st
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
defer node.UploadCancel(sessionId)
|
||||||
|
|
||||||
var cSessionId = C.CString(sessionId)
|
var cSessionId = C.CString(sessionId)
|
||||||
defer C.free(unsafe.Pointer(cSessionId))
|
defer C.free(unsafe.Pointer(cSessionId))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user