Skip to content

Commit 017a470

Browse files
committed
Change exit code on worker's timeout as this is the expected termination.
1 parent 1150c12 commit 017a470

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ndt7.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@
149149
});
150150

151151
// If the worker takes 10 seconds, kill it and return an error code.
152-
setTimeout(() => worker.resolve(2), 10000);
152+
// Most clients take longer than 10 seconds to complete the upload and
153+
// finish sending the buffer's content, sometimes hitting the socket's
154+
// timeout of 15 seconds. This makes sure uploads terminate on time.
155+
setTimeout(() => worker.resolve(0), 10000);
153156

154157
// This is how the worker communicates back to the main thread of
155158
// execution. The MsgTpe of `ev` determines which callback the message

0 commit comments

Comments
 (0)