(instanceId: string)
| 43 | } |
| 44 | |
| 45 | export function recordFreebuffInstanceOwner(instanceId: string): void { |
| 46 | try { |
| 47 | fs.mkdirSync(getConfigDir(), { recursive: true }) |
| 48 | fs.writeFileSync( |
| 49 | getOwnerPath(), |
| 50 | JSON.stringify({ instanceId, pid: process.pid }, null, 2), |
| 51 | ) |
| 52 | } catch (error) { |
| 53 | logger.debug( |
| 54 | { error: error instanceof Error ? error.message : String(error) }, |
| 55 | '[freebuff-session] Failed to record local owner', |
| 56 | ) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | export function isFreebuffInstanceOwnedByDeadLocalProcess( |
| 61 | instanceId: string, |
no test coverage detected