A current-format lock whose socket no daemon listens on.
(pid: number)
| 87 | |
| 88 | /** A current-format lock whose socket no daemon listens on. */ |
| 89 | function writeLock(pid: number): string { |
| 90 | const lockPath = getDaemonPidPath(root); |
| 91 | fs.writeFileSync(lockPath, encodeLockInfo({ |
| 92 | pid, |
| 93 | version: '1.6.2', |
| 94 | socketPath: windows ? '\\\\.\\pipe\\codegraph-2770-nobody-listens' : path.join(root, '.codegraph', 'nobody-listens.sock'), |
| 95 | startedAt: Date.now() - 60_000, |
| 96 | })); |
| 97 | return lockPath; |
| 98 | } |
| 99 | |
| 100 | function stopCommand(pid: number): string { |
| 101 | return windows ? `taskkill /PID ${pid} /F` : `kill ${pid}`; |
no test coverage detected