Skip to content

Commit

Permalink
Fix Decompress bug for symlink (#263)
Browse files Browse the repository at this point in the history
- Fixed an issue where the decompressor would failed to deal with symlink that did not exist
- Fixed an issue where the stream process would not catch all of the errors from the decompressor
- Moved unused code to another file until we release the version
  • Loading branch information
cjlapao authored Jan 7, 2025
1 parent 003e095 commit c5a7780
Show file tree
Hide file tree
Showing 7 changed files with 556 additions and 354 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"envFile": "${workspaceFolder}/.env",
"args": [
"pull",
"${workspaceFolder}/.local/pdfiles/build-empty-machine.aws.pull.pdfile",
"${workspaceFolder}/.local/pdfiles/dropbox-test-vm.aws.pull.pdfile",
]
},
{
Expand Down
16 changes: 16 additions & 0 deletions src/catalog/cacheservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,14 @@ func (cs *CacheService) Get() (*models.CacheResponse, error) {
if info, err := os.Stat(packCacheFilePath); err == nil && info.IsDir() {
cs.baseCtx.LogDebugf("Cache file %v is a directory, treating it as a folder", cs.packCacheFilename())
r.Type = models.CatalogCacheTypeFolder
// Checking the integrity of the cache file
configPath := filepath.Join(packCacheFilePath, "config.pvs")
if !helper.FileExists(configPath) {
cs.RemoveCacheItem(cs.manifest.CatalogId, cs.manifest.Version)
r.IsCached = false
cs.cacheData = &r
return cs.cacheData, nil
}
} else {
r.Type = models.CatalogCacheTypeFile
}
Expand All @@ -687,6 +695,14 @@ func (cs *CacheService) Get() (*models.CacheResponse, error) {
if info, err := os.Stat(machineCacheFilePath); err == nil && info.IsDir() {
cs.baseCtx.LogDebugf("Cache file %v is a directory, treating it as a folder", cs.cacheMachineName())
r.Type = models.CatalogCacheTypeFolder
// Checking the integrity of the cache file
configPath := filepath.Join(machineCacheFilePath, "config.pvs")
if !helper.FileExists(configPath) {
cs.RemoveCacheItem(cs.manifest.CatalogId, cs.manifest.Version)
r.IsCached = false
cs.cacheData = &r
return cs.cacheData, nil
}
} else {
r.Type = models.CatalogCacheTypeFile
}
Expand Down
Loading

0 comments on commit c5a7780

Please sign in to comment.