Skip to content

Commit

Permalink
remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
poolpOrg committed Oct 13, 2023
1 parent d67d028 commit bb5ce41
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions snapshot/cacheWrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func (snapshot *Snapshot) GetCachedObject(pathname string) (*CachedObject, error
defer func() {
profiler.RecordEvent("snapshot.GetCachedObject", time.Since(t0))
}()
//secret := snapshot.repository.GetSecret()
cache := snapshot.repository.GetCache()

pathHasher := encryption.GetHasher(snapshot.repository.Configuration().Hashing)
Expand All @@ -39,26 +38,11 @@ func (snapshot *Snapshot) GetCachedObject(pathname string) (*CachedObject, error
}
logger.Trace("snapshot", "%s: cache.GetPath(%s): OK", snapshot.Metadata.GetIndexShortID(), pathname)

/*
if snapshot.repository.Configuration().Encryption != "" {
tmp, err := encryption.Decrypt(secret, data)
if err != nil {
return nil, err
}
data = tmp
}
data, err = compression.Inflate(snapshot.repository.Configuration().Compression, data)
if err != nil {
return nil, err
}
*/
cacheObject := CachedObject{}
err = msgpack.Unmarshal(data, &cacheObject)
if err != nil {
return nil, err
}
// cacheObject.Info.path = pathname
return &cacheObject, nil
}

Expand All @@ -67,7 +51,6 @@ func (snapshot *Snapshot) PutCachedObject(pathname string, object objects.Object
defer func() {
profiler.RecordEvent("snapshot.PutCachedObject", time.Since(t0))
}()
// secret := snapshot.repository.GetSecret()
cache := snapshot.repository.GetCache()

pathHasher := encryption.GetHasher(snapshot.repository.Configuration().Hashing)
Expand All @@ -91,21 +74,6 @@ func (snapshot *Snapshot) PutCachedObject(pathname string, object objects.Object
return err
}

/*
jobject, err = compression.Deflate(snapshot.repository.Configuration().Compression, jobject)
if err != nil {
return err
}
if snapshot.repository.Configuration().Encryption != "" {
tmp, err := encryption.Encrypt(secret, jobject)
if err != nil {
return err
}
jobject = tmp
}
*/

logger.Trace("snapshot", "%s: cache.PutPath(%s)", snapshot.Metadata.GetIndexShortID(), pathname)
cache.PutPath(snapshot.repository.Configuration().RepositoryID.String(), hashedPath, jobject)
return nil
Expand Down

0 comments on commit bb5ce41

Please sign in to comment.