Skip to content

Commit 8615ac2

Browse files
Test UserPaperclip-Paperclip
authored andcommitted
refactor(heartbeat): remove unreachable else-branch in buildAdapterLivenessLostMessage
The staleThresholdMs <= 0 fallback was dead code — the sole call site already guards with `if (staleThresholdMs <= 0) continue` before invoking this function, so staleThresholdMs is always positive. Addresses Greptile P2 finding on PR paperclipai#4162. Co-Authored-By: Paperclip <noreply@paperclip.ing>
1 parent 1a48c55 commit 8615ac2

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

server/src/services/heartbeat.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,11 +1569,8 @@ function adapterHasOutOfProcessLiveness(adapterType: string) {
15691569
}
15701570

15711571
function buildAdapterLivenessLostMessage(adapterType: string, staleThresholdMs: number) {
1572-
if (staleThresholdMs > 0) {
1573-
const staleSec = Math.round(staleThresholdMs / 1000);
1574-
return `Adapter ${adapterType} liveness lost -- no run activity for over ${staleSec}s (out-of-process adapter; local pid not applicable)`;
1575-
}
1576-
return `Adapter ${adapterType} liveness lost -- no run activity (out-of-process adapter; local pid not applicable)`;
1572+
const staleSec = Math.round(staleThresholdMs / 1000);
1573+
return `Adapter ${adapterType} liveness lost -- no run activity for over ${staleSec}s (out-of-process adapter; local pid not applicable)`;
15771574
}
15781575

15791576
// A positive liveness check means some process currently owns the PID.

0 commit comments

Comments
 (0)