|
14 | 14 | * See the License for the specific language governing permissions and |
15 | 15 | * limitations under the License. |
16 | 16 | */ |
17 | | - |
18 | | -import PQueue from 'p-queue'; |
19 | 17 | import Debug from 'debug'; |
| 18 | +import PQueue from 'p-queue'; |
20 | 19 |
|
21 | | -import { File, FilePart, FilePartMetadata, FileState } from './../file'; |
22 | | -import { StoreUploadOptions } from './../types'; |
23 | | -import { FsRequest, FsResponse, FsRequestError, FsCancelToken } from './../../../request'; |
24 | | -import { uniqueTime, uniqueId, filterObject } from './../../../utils'; |
25 | | -import { UploaderAbstract, UploadMode, INTELLIGENT_CHUNK_SIZE, MIN_CHUNK_SIZE, DEFAULT_STORE_LOCATION } from './abstract'; |
26 | 20 | import { FilestackError, FilestackErrorType } from './../../../../filestack_error'; |
| 21 | +import { FsCancelToken, FsRequest, FsRequestError, FsResponse } from './../../../request'; |
27 | 22 | import { shouldRetry } from './../../../request/helpers'; |
| 23 | +import { filterObject, uniqueId, uniqueTime } from './../../../utils'; |
| 24 | +import { File, FilePart, FilePartMetadata, FileState } from './../file'; |
| 25 | +import { StoreUploadOptions } from './../types'; |
| 26 | +import { DEFAULT_STORE_LOCATION, INTELLIGENT_CHUNK_SIZE, MIN_CHUNK_SIZE, UploaderAbstract, UploadMode } from './abstract'; |
28 | 27 |
|
29 | 28 | const debug = Debug('fs:upload:s3'); |
30 | 29 |
|
@@ -601,7 +600,7 @@ export class S3Uploader extends UploaderAbstract { |
601 | 600 |
|
602 | 601 | // reset progress on failed upload |
603 | 602 | this.onProgressUpdate(id, partNumber, part.offset); |
604 | | - const nextChunkSize = chunkSize / 2; |
| 603 | + const nextChunkSize = Math.ceil(chunkSize / 2); |
605 | 604 |
|
606 | 605 | if (nextChunkSize < MIN_CHUNK_SIZE) { |
607 | 606 | debug(`[${id}] Minimal chunk size limit. Upload file failed!`); |
|
0 commit comments