Skip to content

Commit

Permalink
fix req complete cb
Browse files Browse the repository at this point in the history
  • Loading branch information
Hitenjain14 committed Jan 28, 2024
1 parent de8ef8c commit 8efc535
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zboxcore/sdk/downloadworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ func (req *DownloadRequest) processDownload(ctx context.Context) {
elapsedGetBlocksAndWrite.Milliseconds(),
))

if req.statusCallback != nil {
if req.statusCallback != nil && !req.skip {
req.statusCallback.Completed(
req.allocationID, remotePathCB, fRef.Name, "", int(size), op)
}
Expand Down Expand Up @@ -828,6 +828,9 @@ func (req *DownloadRequest) errorCB(err error, remotePathCB string) {
if req.contentMode == DOWNLOAD_CONTENT_THUMB {
op = opThumbnailDownload
}
if req.skip {
return
}
req.skip = true
if req.localFilePath != "" {
if info, err := req.fileHandler.Stat(); err == nil && info.Size() == 0 {
Expand Down

0 comments on commit 8efc535

Please sign in to comment.