Commit 29ce3261 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Avoid final empty block creation when file size is greater than block size.

parent f10cefd4
Loading
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -191,16 +191,14 @@ class RetrieveExecutor(TaskExecutor):
                #self.totalSize += fileSize
                # check if the file is larger than a block size
                if fileSize > self.maxBlockSize:
                    # if the current block is not empty, "close" it, otherwise
                    # use it and then create a new block
                    # if the current block is not empty, "close" it,
                    # otherwise use it
                    if blockSize > 0:
                        blockIdx += 1
                        fileInfo["blockIdx"] = blockIdx
                        blockIdx += 1
                    else:
                        fileInfo["blockIdx"] = blockIdx
                        blockIdx += 1
                    blockSize = 0
                    blockSize = self.maxBlockSize
                else:
                    # the file can be contained by a block, so check if
                    # the file size plus the current block fill is lower