objcache: Return io.ReaderAt to avoid Seeking and Reading. (#3735)

This commit is contained in:
Harshavardhana
2017-02-11 17:17:58 -08:00
committed by GitHub
parent 440866d26c
commit 22909c849e
3 changed files with 14 additions and 11 deletions

View File

@@ -217,7 +217,7 @@ func (c *Cache) Create(key string, size int64) (w io.WriteCloser, err error) {
// returns an error ErrNotFoundInCache, if the key does not exist.
// Returns ErrKeyNotFoundInCache if entry's lastAccessedTime is older
// than objModTime.
func (c *Cache) Open(key string, objModTime time.Time) (io.ReadSeeker, error) {
func (c *Cache) Open(key string, objModTime time.Time) (io.ReaderAt, error) {
// Entry exists, return the readable buffer.
c.mutex.Lock()
defer c.mutex.Unlock()