droid-mode 0.0.4 → 0.0.5
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
|
@@ -175,9 +175,12 @@ export async function executeWorkflow(opts) {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
const resultPromise = Promise.resolve().then(() => sandbox.workflow());
|
|
178
|
+
let timeoutId;
|
|
178
179
|
const timed = Promise.race([
|
|
179
|
-
resultPromise,
|
|
180
|
-
new Promise((_, reject) =>
|
|
180
|
+
resultPromise.finally(() => clearTimeout(timeoutId)),
|
|
181
|
+
new Promise((_, reject) => {
|
|
182
|
+
timeoutId = setTimeout(() => reject(new Error(`Workflow timed out after ${timeoutMs}ms`)), timeoutMs);
|
|
183
|
+
}),
|
|
181
184
|
]);
|
|
182
185
|
|
|
183
186
|
const result = await timed;
|