Skip to content

Commit aa262bd

Browse files
committed
fixup! Add stall detection to recover from frozen uploads
1 parent e5f7871 commit aa262bd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/upload.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,10 @@ export class BaseUpload {
353353
if (totalSize == null) {
354354
throw new Error('tus: Expected totalSize to be set')
355355
}
356+
357+
// Update progress timestamp for the parallel upload to track stalls
358+
upload._lastProgressTime = Date.now()
359+
356360
this._emitProgress(totalProgress, totalSize)
357361
},
358362
// Wait until every partial upload has an upload URL, so we can add
@@ -1083,13 +1087,9 @@ export class BaseUpload {
10831087

10841088
this._clearStallDetection()
10851089

1086-
// If using parallel uploads, abort them all
1087-
if (this._parallelUploads) {
1088-
for (const upload of this._parallelUploads) {
1089-
upload.abort()
1090-
}
1091-
} else if (this._req) {
1092-
// For single uploads, abort the current request
1090+
// Just abort the current request, not the entire upload
1091+
// Each parallel upload instance has its own stall detection
1092+
if (this._req) {
10931093
this._req.abort()
10941094
}
10951095

0 commit comments

Comments
 (0)