Skip to content

Commit 454838c

Browse files
committed
fix: avoid reusing stopping panel tunnels
1 parent 7559324 commit 454838c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/api/src/services/panel-cloudflare-tunnel.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ const isReusableRecord = (
348348
record: PanelCloudflareTunnelRecord,
349349
panelUrl: string
350350
): boolean =>
351+
!record.stopping &&
351352
record.session.panelUrl === panelUrl &&
352353
Match.value(record.session.status).pipe(
353354
Match.when("failed", () => false),
@@ -450,7 +451,7 @@ export const stopPanelCloudflareTunnel = (): Effect.Effect<PanelCloudflareTunnel
450451
if (currentRecord === null) {
451452
return null
452453
}
453-
if (isTerminalTunnelSession(currentRecord.session)) {
454+
if (currentRecord.stopping || isTerminalTunnelSession(currentRecord.session)) {
454455
return currentRecord.session
455456
}
456457
return yield* _(stopRecord(currentRecord))

0 commit comments

Comments
 (0)