( entry: DaemonRegistryEntry, workspaceKey: string, options?: DaemonFileCleanupOptions, )
| 205 | } |
| 206 | |
| 207 | function canRemoveRegistryEntry( |
| 208 | entry: DaemonRegistryEntry, |
| 209 | workspaceKey: string, |
| 210 | options?: DaemonFileCleanupOptions, |
| 211 | ): boolean { |
| 212 | if (!entryMatchesCleanupTarget(entry, workspaceKey, options)) { |
| 213 | return false; |
| 214 | } |
| 215 | |
| 216 | if (!isPidAlive(entry.pid)) { |
| 217 | return true; |
| 218 | } |
| 219 | |
| 220 | if (options?.allowLiveOwner !== true) { |
| 221 | return false; |
| 222 | } |
| 223 | if (options.pid === undefined || entry.pid !== options.pid) { |
| 224 | return false; |
| 225 | } |
| 226 | return entry.instanceId !== undefined && options.instanceId === entry.instanceId; |
| 227 | } |
| 228 | |
| 229 | function removeRegistryAtPathIfOwned( |
| 230 | registryPath: string, |
no test coverage detected