mirror of
https://github.com/kopia/kopia.git
synced 2026-05-19 20:24:46 -04:00
also close current pack when time-based flushing happens
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
"github.com/kopia/kopia/blob"
|
||||
)
|
||||
|
||||
const flushPackIndexTimeout = 10 * time.Minute
|
||||
const flushPackIndexTimeout = 10 * time.Second
|
||||
const packObjectPrefix = "P"
|
||||
|
||||
type packInfo struct {
|
||||
@@ -133,7 +133,12 @@ func (p *packManager) AddToPack(packGroup string, blockID string, data []byte) (
|
||||
}
|
||||
|
||||
if time.Now().After(p.flushPackIndexesAfter) {
|
||||
p.flushPackIndexesLocked()
|
||||
if err := p.finishCurrentPackLocked(); err != nil {
|
||||
return NullObjectID, err
|
||||
}
|
||||
if err := p.flushPackIndexesLocked(); err != nil {
|
||||
return NullObjectID, err
|
||||
}
|
||||
}
|
||||
|
||||
p.blockToIndex[blockID] = g.currentPackIndex
|
||||
|
||||
Reference in New Issue
Block a user