@wixc3/engine-core
Advanced tools
Comparing version 42.1.0 to 42.1.1
@@ -11,2 +11,3 @@ import { type AnyEnvironment, type FeatureClass } from './entities/index.js'; | ||
private running; | ||
private shutingDown; | ||
private topLevelConfigMap; | ||
@@ -13,0 +14,0 @@ runningEnvNames: Set<string>; |
@@ -14,2 +14,3 @@ "use strict"; | ||
this.features = new Map(); | ||
this.shutingDown = false; | ||
this.shutdown = async () => { | ||
@@ -19,9 +20,18 @@ if (!this.running) { | ||
} | ||
// don't report error on running | ||
await Promise.allSettled([this.running]); | ||
this.running = undefined; | ||
const toDispose = Array.from(this.features.values()).reverse(); | ||
for (const feature of toDispose) { | ||
await (0, promise_assist_1.timeout)(feature.dispose(), this.featureShutdownTimeout, `Failed to dispose feature: ${feature.feature.id}`); | ||
if (this.shutingDown) { | ||
return; | ||
} | ||
this.shutingDown = true; | ||
try { | ||
// don't report error on running | ||
await Promise.allSettled([this.running]); | ||
this.running = undefined; | ||
const toDispose = Array.from(this.features.values()).reverse(); | ||
for (const feature of toDispose) { | ||
await (0, promise_assist_1.timeout)(feature.dispose(), this.featureShutdownTimeout, `Failed to dispose feature: ${feature.feature.id}`); | ||
} | ||
} | ||
finally { | ||
this.shutingDown = false; | ||
} | ||
}; | ||
@@ -28,0 +38,0 @@ this.topLevelConfigMap = this.createConfigMap(topLevelConfig); |
{ | ||
"name": "@wixc3/engine-core", | ||
"version": "42.1.0", | ||
"version": "42.1.1", | ||
"main": "dist/index.js", | ||
@@ -21,3 +21,3 @@ "exports": { | ||
"@wixc3/isomorphic-worker": "^1.2.5", | ||
"@wixc3/patterns": "^14.1.0", | ||
"@wixc3/patterns": "^14.1.1", | ||
"promise-assist": "^2.0.1", | ||
@@ -24,0 +24,0 @@ "socket.io-client": "^4.7.2", |
@@ -17,2 +17,3 @@ import { timeout } from 'promise-assist'; | ||
private running: Promise<void[]> | undefined; | ||
private shutingDown = false; | ||
private topLevelConfigMap: Record<string, object[]>; | ||
@@ -90,13 +91,21 @@ public runningEnvNames: Set<string>; | ||
} | ||
// don't report error on running | ||
await Promise.allSettled([this.running]); | ||
this.running = undefined; | ||
const toDispose = Array.from(this.features.values()).reverse(); | ||
for (const feature of toDispose) { | ||
await timeout( | ||
feature.dispose(), | ||
this.featureShutdownTimeout, | ||
`Failed to dispose feature: ${feature.feature.id}`, | ||
); | ||
if (this.shutingDown) { | ||
return; | ||
} | ||
this.shutingDown = true; | ||
try { | ||
// don't report error on running | ||
await Promise.allSettled([this.running]); | ||
this.running = undefined; | ||
const toDispose = Array.from(this.features.values()).reverse(); | ||
for (const feature of toDispose) { | ||
await timeout( | ||
feature.dispose(), | ||
this.featureShutdownTimeout, | ||
`Failed to dispose feature: ${feature.feature.id}`, | ||
); | ||
} | ||
} finally { | ||
this.shutingDown = false; | ||
} | ||
}; | ||
@@ -103,0 +112,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1327169
13188
Updated@wixc3/patterns@^14.1.1