MCPcopy Index your code
hub / github.com/coder/code-server / idleTimer

Function idleTimer

test/utils/helpers.ts:97–109  ·  view source on GitHub ↗
(message: string, reject: (error: Error) => void, delay = 5000)

Source from the content-addressed store, hash-verified

95 * reset before the delay elapses.
96 */
97export function idleTimer(message: string, reject: (error: Error) => void, delay = 5000) {
98 const start = () => setTimeout(() => reject(new Error(message)), delay)
99 let timeout = start()
100 return {
101 reset: () => {
102 clearTimeout(timeout)
103 timeout = start()
104 },
105 dispose: () => {
106 clearTimeout(timeout)
107 },
108 }
109}
110
111/**
112 * If using a proxy, return the address of the proxy.

Callers 1

spawnMethod · 0.90

Calls 1

startFunction · 0.85

Tested by

no test coverage detected