@nxtedition/lib 19.0.32 → 19.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/s3.js +5 -17
package/package.json
CHANGED
package/s3.js
CHANGED
|
@@ -95,9 +95,7 @@ class PartUploader {
|
|
|
95
95
|
)
|
|
96
96
|
this.#logger?.debug({ etag: ETag }, 'uploaded part')
|
|
97
97
|
|
|
98
|
-
return {
|
|
99
|
-
} catch (err) {
|
|
100
|
-
return { error: err }
|
|
98
|
+
return { ETag, PartNumber: this.#number }
|
|
101
99
|
} finally {
|
|
102
100
|
await fs.promises.unlink(this.#writable.path)
|
|
103
101
|
this.#logger?.debug('deleted part')
|
|
@@ -187,7 +185,9 @@ export async function upload({
|
|
|
187
185
|
})
|
|
188
186
|
|
|
189
187
|
const promise = queue.add(() => part.end(s3, { Bucket, Key, UploadId: uploadId }))
|
|
190
|
-
promise.catch(() => {
|
|
188
|
+
promise.catch((err) => {
|
|
189
|
+
ac.abort(err)
|
|
190
|
+
})
|
|
191
191
|
promises.push(promise)
|
|
192
192
|
}
|
|
193
193
|
}
|
|
@@ -208,21 +208,9 @@ export async function upload({
|
|
|
208
208
|
}
|
|
209
209
|
maybeFlush()
|
|
210
210
|
|
|
211
|
-
const parts =
|
|
212
|
-
const errors = []
|
|
213
|
-
for (const { part, error } of await Promise.all(promises)) {
|
|
214
|
-
if (error) {
|
|
215
|
-
errors.push(error)
|
|
216
|
-
} else {
|
|
217
|
-
parts.push(part)
|
|
218
|
-
}
|
|
219
|
-
}
|
|
211
|
+
const parts = await Promise.all(promises)
|
|
220
212
|
signal.throwIfAborted()
|
|
221
213
|
|
|
222
|
-
if (errors.length > 0) {
|
|
223
|
-
throw new AggregateError(errors, 'upload failed')
|
|
224
|
-
}
|
|
225
|
-
|
|
226
214
|
if (parts.length === 0) {
|
|
227
215
|
throw new Error('upload empty')
|
|
228
216
|
}
|