mirror of
https://github.com/trycua/computer.git
synced 2026-01-06 21:39:58 -06:00
Fix first pull
This commit is contained in:
@@ -1011,6 +1011,12 @@ class ImageContainerRegistry: @unchecked Sendable {
|
||||
// Move files to final location
|
||||
try FileManager.default.moveItem(at: tempVMDir, to: URL(fileURLWithPath: vmDir.dir.path))
|
||||
|
||||
// If caching is disabled, clean up the cache entry
|
||||
if !cachingEnabled {
|
||||
Logger.info("Caching disabled - cleaning up temporary cache entry")
|
||||
try? cleanupCacheEntry(manifestId: manifestId)
|
||||
}
|
||||
|
||||
Logger.info("Download complete: Files extracted to \(vmDir.dir.path)")
|
||||
Logger.info(
|
||||
"Note: Actual disk usage is significantly lower than reported size due to macOS sparse file system"
|
||||
@@ -1020,6 +1026,16 @@ class ImageContainerRegistry: @unchecked Sendable {
|
||||
)
|
||||
}
|
||||
|
||||
// Helper function to clean up a specific cache entry
|
||||
private func cleanupCacheEntry(manifestId: String) throws {
|
||||
let cacheDir = getImageCacheDirectory(manifestId: manifestId)
|
||||
|
||||
if FileManager.default.fileExists(atPath: cacheDir.path) {
|
||||
Logger.info("Removing cache entry for manifest ID: \(manifestId)")
|
||||
try FileManager.default.removeItem(at: cacheDir)
|
||||
}
|
||||
}
|
||||
|
||||
// Shared function to handle disk image creation - can be used by both cache hit and cache miss paths
|
||||
private func createDiskImageFromSource(
|
||||
sourceURL: URL, // Source data to decompress
|
||||
|
||||
Reference in New Issue
Block a user