fix(tests): fix tests

This commit is contained in:
Juergen Kunz
2025-06-23 08:38:14 +00:00
parent 1aead55296
commit be58700a2f
14 changed files with 153 additions and 107 deletions

View File

@ -94,12 +94,17 @@ export class TimeoutManager {
public setupConnectionTimeout(
record: IConnectionRecord,
onTimeout: (record: IConnectionRecord, reason: string) => void
): NodeJS.Timeout {
): NodeJS.Timeout | null {
// Clear any existing timer
if (record.cleanupTimer) {
clearTimeout(record.cleanupTimer);
}
// Skip timeout for immortal keep-alive connections
if (record.hasKeepAlive && this.smartProxy.settings.keepAliveTreatment === 'immortal') {
return null;
}
// Calculate effective timeout
const effectiveLifetime = this.getEffectiveMaxLifetime(record);