1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-03 17:13:18 +00:00

cache: plex integration, refactor chunk storage and worker retries (#1899)

This commit is contained in:
remusb
2017-12-09 23:54:26 +02:00
committed by GitHub
parent b05e472d2e
commit b48b537325
14 changed files with 781 additions and 652 deletions

View File

@@ -1,4 +1,4 @@
// +build !plan9
// +build !plan9,go1.7
package cache
@@ -58,8 +58,8 @@ func (m *Memory) GetChunk(cachedObject *Object, offset int64) ([]byte, error) {
}
// AddChunk adds a new chunk of a cached object
func (m *Memory) AddChunk(cachedObject *Object, data []byte, offset int64) error {
return m.AddChunkAhead(cachedObject.abs(), data, offset, time.Second)
func (m *Memory) AddChunk(fp string, data []byte, offset int64) error {
return m.AddChunkAhead(fp, data, offset, time.Second)
}
// AddChunkAhead adds a new chunk of a cached object
@@ -93,3 +93,8 @@ func (m *Memory) CleanChunksByNeed(offset int64) {
}
}
}
// CleanChunksBySize will cleanup chunks after the total size passes a certain point
func (m *Memory) CleanChunksBySize(maxSize int64) {
// NOOP
}