dsh-wsr-execution 0.2.7 → 0.2.8
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/src/intake/plugin.js +10 -1
package/package.json
CHANGED
package/src/intake/plugin.js
CHANGED
|
@@ -271,7 +271,16 @@ export async function createPluginRuntime(config, options = {}) {
|
|
|
271
271
|
const ownerProjection = options.ownerProjection ?? api.getExecutionControlPlaneProjection(application);
|
|
272
272
|
const bindingInventory = () => typeof control.bindingInventory === "function" ? control.bindingInventory() : control.list();
|
|
273
273
|
const archiveTerminal = async (sessionKey, correlation, deliveryId) => {
|
|
274
|
-
|
|
274
|
+
let snapshot;
|
|
275
|
+
for (let attempt = 0; attempt < 100; attempt += 1) {
|
|
276
|
+
try {
|
|
277
|
+
snapshot = await ownerProjection.snapshot();
|
|
278
|
+
break;
|
|
279
|
+
} catch (cause) {
|
|
280
|
+
if (cause?.code !== "DELIVERY_PROJECTION_STALE_BINDING" || attempt === 99) throw cause;
|
|
281
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
282
|
+
}
|
|
283
|
+
}
|
|
275
284
|
const matches = snapshot.deliveries.filter((delivery) => delivery.lifecycle === "TERMINAL"
|
|
276
285
|
&& delivery.navigation?.sessionCorrelation === correlation
|
|
277
286
|
&& (deliveryId === undefined || delivery.deliveryId === deliveryId));
|