mirror of https://github.com/perkeep/perkeep.git
sync: restore key part accidentally removed prior to earlier submit
Would cause accounting errors before in the face of duplicate uploads. Change-Id: Ie7c49da1adaf2b9c98ef1015f875a4df8b66729f
This commit is contained in:
parent
c1892b5ae5
commit
58ac8b5469
|
@ -518,6 +518,9 @@ func (sh *SyncHandler) ReceiveBlob(br blob.Ref, r io.Reader) (sb blob.SizedRef,
|
||||||
func (sh *SyncHandler) addBlobToCopy(sb blob.SizedRef) bool {
|
func (sh *SyncHandler) addBlobToCopy(sb blob.SizedRef) bool {
|
||||||
sh.mu.Lock()
|
sh.mu.Lock()
|
||||||
defer sh.mu.Unlock()
|
defer sh.mu.Unlock()
|
||||||
|
if _, dup := sh.needCopy[sb.Ref]; dup {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
sh.needCopy[sb.Ref] = sb.Size
|
sh.needCopy[sb.Ref] = sb.Size
|
||||||
sh.bytesRemain += int64(sb.Size)
|
sh.bytesRemain += int64(sb.Size)
|
||||||
|
|
Loading…
Reference in New Issue