-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #888 from chromaui/ghengeveld/ap-4034-batch-file-u…
…pload-requests-to-handle-thousands-of-files Replace upload mechanism to use a batched mutation with a new API
- Loading branch information
Showing
33 changed files
with
874 additions
and
426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ReadStream, createReadStream } from 'fs'; | ||
|
||
export class FileReaderBlob { | ||
readStream: ReadStream; | ||
size: number; | ||
|
||
constructor(filePath: string, contentLength: number, onProgress: (delta: number) => void) { | ||
this.size = contentLength; | ||
this.readStream = createReadStream(filePath); | ||
this.readStream.on('data', (chunk: Buffer | string) => onProgress(chunk.length)); | ||
} | ||
|
||
stream() { | ||
return this.readStream; | ||
} | ||
|
||
get [Symbol.toStringTag]() { | ||
return 'Blob'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.