Migrate ordinary I/O from confined file helpers
This commit is contained in:
@@ -57,7 +57,7 @@ func cacheIdentityEligible(req S3MaterializeRequest) bool {
|
||||
}
|
||||
|
||||
func loadAudioCacheIdentity(path string) (audioCacheIdentity, bool, error) {
|
||||
data, err := fileops.ReadRegularFile(path, 64*1024)
|
||||
data, err := fileops.ReadFileBounded(path, 64*1024)
|
||||
if os.IsNotExist(err) {
|
||||
return audioCacheIdentity{}, false, nil
|
||||
}
|
||||
@@ -99,11 +99,7 @@ func materializeVerifiedCachedAudio(ctx context.Context, req S3MaterializeReques
|
||||
return "", false, nil
|
||||
}
|
||||
|
||||
relativePath, err := cacheRelativePath(req.CacheRoot, cachePath)
|
||||
if err != nil {
|
||||
return "", false, err
|
||||
}
|
||||
source, err := fileops.OpenConfinedRegularFile(req.CacheRoot, relativePath)
|
||||
source, err := os.Open(cachePath)
|
||||
if err != nil {
|
||||
return "", false, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user