@contember/engine-actions 1.3.0-rc.3 → 1.3.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contember/engine-actions",
3
- "version": "1.3.0-rc.3",
3
+ "version": "1.3.2",
4
4
  "license": "proprietary",
5
5
  "main": "dist/src/index.js",
6
6
  "typings": "dist/src/index.d.ts",
@@ -13,25 +13,25 @@
13
13
  "test": "vitest --no-threads"
14
14
  },
15
15
  "dependencies": {
16
- "@contember/authorization": "1.3.0-rc.3",
17
- "@contember/database": "1.3.0-rc.3",
18
- "@contember/database-migrations": "1.3.0-rc.3",
19
- "@contember/engine-common": "1.3.0-rc.3",
20
- "@contember/engine-content-api": "1.3.0-rc.3",
21
- "@contember/engine-http": "1.3.0-rc.3",
22
- "@contember/engine-plugins": "1.3.0-rc.3",
23
- "@contember/engine-system-api": "1.3.0-rc.3",
24
- "@contember/engine-tenant-api": "1.3.0-rc.3",
25
- "@contember/graphql-utils": "1.3.0-rc.3",
26
- "@contember/logger": "1.3.0-rc.3",
27
- "@contember/schema": "1.3.0-rc.3",
28
- "@contember/schema-utils": "1.3.0-rc.3",
29
- "@contember/typesafe": "1.3.0-rc.3",
16
+ "@contember/authorization": "1.3.2",
17
+ "@contember/database": "1.3.2",
18
+ "@contember/database-migrations": "1.3.2",
19
+ "@contember/engine-common": "1.3.2",
20
+ "@contember/engine-content-api": "1.3.2",
21
+ "@contember/engine-http": "1.3.2",
22
+ "@contember/engine-plugins": "1.3.2",
23
+ "@contember/engine-system-api": "1.3.2",
24
+ "@contember/engine-tenant-api": "1.3.2",
25
+ "@contember/graphql-utils": "1.3.2",
26
+ "@contember/logger": "1.3.2",
27
+ "@contember/schema": "1.3.2",
28
+ "@contember/schema-utils": "1.3.2",
29
+ "@contember/typesafe": "1.3.2",
30
30
  "@graphql-tools/schema": "^8.3.5",
31
31
  "graphql-tag": "^2.12.5"
32
32
  },
33
33
  "devDependencies": {
34
- "@contember/engine-api-tester": "1.3.0-rc.3",
34
+ "@contember/engine-api-tester": "1.3.2",
35
35
  "@graphql-codegen/cli": "^2.6.2",
36
36
  "@graphql-codegen/typescript": "^2.5.1",
37
37
  "@graphql-codegen/typescript-operations": "^2.4.2",
@@ -66,7 +66,7 @@ export class ActionsWebsocketControllerFactory {
66
66
  ws.send(JSON.stringify(message))
67
67
  }
68
68
 
69
- let workers: { id: string; running: Running }[] = []
69
+ let workers: { id: string; running: Promise<Running> }[] = []
70
70
  const abortListener = async () => {
71
71
  send({ type: 'message', message: 'shutting down' })
72
72
  await stopAll()
@@ -76,10 +76,13 @@ export class ActionsWebsocketControllerFactory {
76
76
  ctx.abortSignal.addEventListener('abort', abortListener)
77
77
 
78
78
  const stopAll = async () => {
79
- const currentWorkers = workers.map(it => it.running.end().then(() => send({
80
- type: 'workedStopped',
81
- workerId: it.id,
82
- })))
79
+ const currentWorkers = workers.map(async it => {
80
+ await (await it.running).end()
81
+ send({
82
+ type: 'workedStopped',
83
+ workerId: it.id,
84
+ })
85
+ })
83
86
  workers = []
84
87
  await Promise.all(currentWorkers)
85
88
  }
@@ -110,10 +113,11 @@ export class ActionsWebsocketControllerFactory {
110
113
  const workerId = Math.random().toString().substring(2)
111
114
  const dispatchSupervisor = this.dispatchWorkerSupervisorFactory.create(projectGroup)
112
115
  try {
113
- const running = await dispatchSupervisor.run({ logger, onError: () => {
116
+ const running = dispatchSupervisor.run({ logger, onError: () => {
114
117
  send({ type: 'workerCrashed', workerId })
115
118
  } })
116
119
  workers.push({ id: workerId, running })
120
+ await running
117
121
  send({ type: 'workerStarted', workerId })
118
122
  } catch (e) {
119
123
  logger.error(e, { message: 'Worker failed to start' })