Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
whalemare committed May 2, 2021
1 parent 71be168 commit daaedac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/upload/dropbox/DropboxUploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ export class DropboxUploader implements Uploader {
* @returns
*/
uploadStream = async ({ buffer, destination, partSizeBytes = DROPBOX_MAX_BLOB_SIZE, onProgress }: StreamUploader) => {
if (buffer.length <= 0) {
this.logger?.warn(`Skip, because it size is ${buffer.length}`)
return ''
}

const partSize = Math.min(partSizeBytes, DROPBOX_MAX_BLOB_SIZE)

const blobs = []
Expand Down Expand Up @@ -133,6 +138,7 @@ export class DropboxUploader implements Uploader {
contents: blob,
})
.then((it) => {
this.logger?.info(`result uploading: ${JSON.stringify(it.result)}`)
return it.result.id
})
})
Expand Down

0 comments on commit daaedac

Please sign in to comment.