MCPcopy Create free account
hub / github.com/Noumena-Network/code / forceRemoveLock

Function forceRemoveLock

src/utils/nativeInstaller/installer.ts:1159–1170  ·  view source on GitHub ↗

* Force-remove a lock file for a given version path. * Used when --force is specified to bypass stale locks.

(versionFilePath: string)

Source from the content-addressed store, hash-verified

1157 * Used when --force is specified to bypass stale locks.
1158 */
1159async function forceRemoveLock(versionFilePath: string): Promise<void> {
1160 const dirs = getBaseDirectories()
1161 const lockfilePath = getLockFilePathFromVersionPath(dirs, versionFilePath)
1162
1163 try {
1164 await unlink(lockfilePath)
1165 logForDebugging(`Force-removed lock file at ${lockfilePath}`)
1166 } catch (error) {
1167 // Log but don't throw - we'll try to acquire the lock anyway
1168 logForDebugging(`Failed to force-remove lock file: ${errorMessage(error)}`)
1169 }
1170}
1171
1172export async function cleanupOldVersions(): Promise<void> {
1173 // Yield to ensure we don't block startup

Callers 1

updateLatestFunction · 0.85

Calls 5

getBaseDirectoriesFunction · 0.85
unlinkFunction · 0.85
logForDebuggingFunction · 0.50
errorMessageFunction · 0.50

Tested by

no test coverage detected