@nxtedition/lib 22.0.2 → 22.0.4

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 (3) hide show
  1. package/app.js +0 -9
  2. package/package.json +1 -1
  3. package/worker.js +7 -3
package/app.js CHANGED
@@ -8,7 +8,6 @@ import stream from 'node:stream'
8
8
  import { Buffer } from 'node:buffer'
9
9
  import { getDockerSecretsSync } from './docker-secrets.js'
10
10
  import fp from 'lodash/fp.js'
11
- import { mkdirSync } from 'node:fs'
12
11
  import {
13
12
  isMainThread,
14
13
  parentPort,
@@ -46,14 +45,6 @@ export function makeApp(appConfig, onTerminate) {
46
45
  let logger
47
46
  let trace
48
47
 
49
- try {
50
- mkdirSync('./.nxt')
51
- } catch (err) {
52
- if (err.code !== 'EEXIST') {
53
- throw err
54
- }
55
- }
56
-
57
48
  /** @type {Array<rxjs.Subscription|Function|AsyncFunction|Disposable|AsyncDisposable>} */
58
49
  const destroyers = []
59
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "22.0.2",
3
+ "version": "22.0.4",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
package/worker.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { once } from 'node:events'
2
2
 
3
- export async function terminate(worker, { logger = null, timeout = 10e3 } = {}) {
3
+ export async function terminate(worker, { timeout = 10e3 } = {}) {
4
4
  try {
5
5
  worker.postMessage({ type: 'nxt:worker:terminate' })
6
6
  await Promise.race([
@@ -10,7 +10,11 @@ export async function terminate(worker, { logger = null, timeout = 10e3 } = {})
10
10
  ),
11
11
  ])
12
12
  } catch (err) {
13
- worker.terminate()
14
- logger?.error({ err })
13
+ try {
14
+ await worker.terminate()
15
+ throw err
16
+ } catch (er) {
17
+ throw new AggregateError([err, er])
18
+ }
15
19
  }
16
20
  }