fix(files): add debug logs for checking chunks upon finishing upload session
This commit is contained in:
parent
c0fa83bce6
commit
5f0929c1aa
1 changed files with 7 additions and 1 deletions
|
@ -60,7 +60,13 @@ export class FSFileUploader implements FileUploaderInterface {
|
|||
|
||||
const orderedKeys = [...fileChunks.keys()].sort((a, b) => a - b)
|
||||
for (const orderedKey of orderedKeys) {
|
||||
await promises.appendFile(`${this.fileUploadPath}/${filePath}`, fileChunks.get(orderedKey) as Uint8Array)
|
||||
const chunk = fileChunks.get(orderedKey)
|
||||
if (!chunk) {
|
||||
throw new Error(`Could not find chunk ${orderedKey} for upload ${uploadId}`)
|
||||
}
|
||||
|
||||
this.logger.debug(`FS writing chunk ${orderedKey} for ${uploadId}: ${JSON.stringify(chunk)}`)
|
||||
await promises.appendFile(`${this.fileUploadPath}/${filePath}`, chunk)
|
||||
}
|
||||
|
||||
this.inMemoryChunks.delete(uploadId)
|
||||
|
|
Loading…
Reference in a new issue