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:
11
cache/storage_memory.go
vendored
11
cache/storage_memory.go
vendored
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user