Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 897e0ce

Browse files
committedJan 21, 2025·
Use wrapper.exit to perform idle-shutdown
1 parent c884f48 commit 897e0ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/node/heart.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { logger } from "@coder/logger"
22
import { promises as fs } from "fs"
3+
import { wrapper } from "./wrapper"
34

45
/**
56
* Provides a heartbeat using a local file to indicate activity.
@@ -56,7 +57,7 @@ export class Heart {
5657
const timeSinceLastBeat = Date.now() - this.lastHeartbeat
5758
if (timeSinceLastBeat > this.idleTimeout! * 60 * 1000) {
5859
logger.warn(`Idle timeout of ${this.idleTimeout} minutes exceeded`)
59-
process.kill(process.pid, "SIGTERM")
60+
wrapper.exit(5)
6061
}
6162
}, 60000)
6263
}

0 commit comments

Comments
 (0)
Please sign in to comment.