cache: add support for polling
This commit is contained in:
parent
8a25ca786c
commit
b33e3f779c
4 changed files with 351 additions and 94 deletions
3
backend/cache/handle.go
vendored
3
backend/cache/handle.go
vendored
|
@ -249,7 +249,7 @@ func (r *Handle) getChunk(chunkStart int64) ([]byte, error) {
|
|||
if !found {
|
||||
// we're gonna give the workers a chance to pickup the chunk
|
||||
// and retry a couple of times
|
||||
for i := 0; i < r.cacheFs().readRetries*2; i++ {
|
||||
for i := 0; i < r.cacheFs().readRetries*8; i++ {
|
||||
data, err = r.storage().GetChunk(r.cachedObject, chunkStart)
|
||||
if err == nil {
|
||||
found = true
|
||||
|
@ -656,6 +656,7 @@ func (b *backgroundWriter) run() {
|
|||
if err != nil {
|
||||
fs.Errorf(parentCd, "background upload: cache expire error: %v", err)
|
||||
}
|
||||
b.fs.notifyDirChange(remote)
|
||||
fs.Infof(remote, "finished background upload")
|
||||
b.notify(remote, BackgroundUploadCompleted, nil)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue