Skip to content

Commit f21e207

Browse files
committed
Don't report timeouts from the API itself, just send to Sentry
1 parent 3d5f06d commit f21e207

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/api-server.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,14 @@ const buildResolvers = (
8585
const interceptor = interceptors[id];
8686
if (!interceptor) throw new Error(`Unknown interceptor ${id}`);
8787

88-
const result = await Promise.race([
89-
// Activate, and either return metadata, or some error
90-
interceptor.activate(proxyPort, options).catch((e) => e),
91-
// After 30s, we don't stop activating, but we do return an error
92-
delay(30000).then(() => new Error(`Timeout activating ${id}`))
93-
]);
88+
// After 30s, don't stop activating, but report an error if we're not done yet
89+
let activationDone = false;
90+
delay(30000).then(() => {
91+
if (!activationDone) reportError(`Timeout activating ${id}`)
92+
});
93+
94+
const result = await interceptor.activate(proxyPort, options).catch((e) => e);
95+
activationDone = true;
9496

9597
if (_.isError(result)) {
9698
reportError(result);

0 commit comments

Comments
 (0)