@nxtedition/lib 19.0.45 → 19.0.47

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/s3.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "19.0.45",
3
+ "version": "19.0.47",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
package/s3.js CHANGED
@@ -7,7 +7,7 @@ import PQueue from 'p-queue'
7
7
  const CONTENT_MD5_EXPR = /^[A-F0-9]{32}$/i
8
8
  const CONTENT_LENGTH_EXPR = /^\d+$/i
9
9
 
10
- const queue = new PQueue({ concurrency: 16 })
10
+ const queue = new PQueue({ concurrency: 8 })
11
11
 
12
12
  export async function upload({ client: s3, signal, logger, partSize = 16e6, params }) {
13
13
  if (s3 == null) {
@@ -79,7 +79,7 @@ export async function upload({ client: s3, signal, logger, partSize = 16e6, para
79
79
  const chunks = part.chunks
80
80
  const number = part.number
81
81
  const size = part.size
82
- const hasher = part.hasher
82
+ const hash = part.hasher.digest('hex')
83
83
 
84
84
  part.chunks = []
85
85
  part.number += 1
@@ -98,7 +98,7 @@ export async function upload({ client: s3, signal, logger, partSize = 16e6, para
98
98
  Bucket,
99
99
  Key,
100
100
  UploadId: uploadId,
101
- ContentMD5: hasher.digest('base64'),
101
+ ContentMD5: Buffer.from(hash, 'hex').toString('base64'),
102
102
  ContentLength: size,
103
103
  PartNumber: number,
104
104
  Body: new stream.Readable({
@@ -117,7 +117,7 @@ export async function upload({ client: s3, signal, logger, partSize = 16e6, para
117
117
  logger?.warn({ err }, 'part upload failed')
118
118
 
119
119
  if (retryCount < 3) {
120
- logger?.warn({ retryCount }, 'part upload retry')
120
+ logger?.debug({ retryCount }, 'part upload retry')
121
121
  await tp.setTimeout(1e3, undefined, { signal: uploader.signal })
122
122
  } else {
123
123
  uploader.ac.abort(err)