(
entry: DaemonRegistryEntry,
options: WriteDaemonRegistryEntryOptions = {},
)
| 269 | * Creates the daemon metadata directory if it doesn't exist. |
| 270 | */ |
| 271 | export function writeDaemonRegistryEntry( |
| 272 | entry: DaemonRegistryEntry, |
| 273 | options: WriteDaemonRegistryEntryOptions = {}, |
| 274 | ): void { |
| 275 | const result = withDaemonRegistryMutationLock( |
| 276 | entry.workspaceKey, |
| 277 | () => { |
| 278 | const registryPath = registryPathForWorkspaceKey(entry.workspaceKey); |
| 279 | writeFileAtomicSync(registryPath, `${JSON.stringify(entry, null, 2)}\n`); |
| 280 | }, |
| 281 | options.lock, |
| 282 | ); |
| 283 | if (result === null) { |
| 284 | throw new Error(`Unable to acquire daemon registry lock for ${entry.workspaceKey}`); |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | /** |
| 289 | * Read a daemon registry entry by workspace key. |
no test coverage detected