Skip to content

Commit df6c820

Browse files
Merge pull request #8 from OneStepAt4time/fix/issue-3
Stability: Aggressive health check causes connection flapping
2 parents bc61860 + a2e4a97 commit df6c820

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/cdp/client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,12 @@ export class CDPClient {
239239
const result = await Promise.race([
240240
this.evaluate('1+1'),
241241
new Promise<never>((_, reject) =>
242-
setTimeout(() => reject(new Error('health check timeout')), 3000),
242+
setTimeout(() => reject(new Error('health check timeout')), 10000),
243243
),
244244
])
245245
return result.result?.value === 2
246-
} catch {
246+
} catch (err) {
247+
this.logger.debug(`Health check failed: ${err instanceof Error ? err.message : String(err)}`)
247248
this.state.connected = false
248249
return false
249250
}

0 commit comments

Comments
 (0)