mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-24 22:56:26 -08:00
wait that actually fixed it?
This commit is contained in:
parent
e38014bf51
commit
b93fd38bcd
|
@ -353,22 +353,14 @@ export default class Files {
|
||||||
read(){
|
read(){
|
||||||
if (!lastChunkSent) return
|
if (!lastChunkSent) return
|
||||||
lastChunkSent = false
|
lastChunkSent = false
|
||||||
console.log(`${uploadId}: Getting chunk ${position+1}/${attachments.length}`)
|
|
||||||
let gC = position+1
|
|
||||||
getNextChunk().then(async (nextChunk) => {
|
getNextChunk().then(async (nextChunk) => {
|
||||||
ord.push(gC)
|
|
||||||
console.log(`${uploadId}: Got chunk ${gC}/${attachments.length}, next up ${position}. It is ${nextChunk ? "not " : ""}null. Current order : ${ord.map(e => e.toString()).join(" ")}`)
|
|
||||||
if (nextChunk == "__ERR") {this.destroy(new Error("file read error")); return}
|
if (nextChunk == "__ERR") {this.destroy(new Error("file read error")); return}
|
||||||
let response = this.push(nextChunk)
|
let response = this.push(nextChunk)
|
||||||
|
|
||||||
if (!nextChunk) return // EOF
|
if (!nextChunk) return // EOF
|
||||||
|
|
||||||
while (response) {
|
while (response) {
|
||||||
console.log(`${uploadId}: Getting chunk ${position+1}/${attachments.length}`)
|
|
||||||
let gC = position+1
|
|
||||||
let nextChunk = await getNextChunk()
|
let nextChunk = await getNextChunk()
|
||||||
ord.push(gC)
|
|
||||||
console.log(`${uploadId}: Got chunk ${gC}/${attachments.length}, next up ${position}. It is ${nextChunk ? "not " : ""}null. Current order : ${ord.map(e => e.toString()).join(" ")}`)
|
|
||||||
response = this.push(nextChunk)
|
response = this.push(nextChunk)
|
||||||
if (!nextChunk) return
|
if (!nextChunk) return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue