mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
Don't count deleted files in synced bytes (fixes #88)
This commit is contained in:
parent
473df1bd19
commit
d2d32f26c7
@ -162,7 +162,9 @@ func (m *Model) ConnectionStats() map[string]ConnectionInfo {
|
|||||||
|
|
||||||
var tot int64
|
var tot int64
|
||||||
for _, f := range m.global {
|
for _, f := range m.global {
|
||||||
tot += f.Size
|
if f.Flags&protocol.FlagDeleted == 0 {
|
||||||
|
tot += f.Size
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var res = make(map[string]ConnectionInfo)
|
var res = make(map[string]ConnectionInfo)
|
||||||
@ -178,7 +180,7 @@ func (m *Model) ConnectionStats() map[string]ConnectionInfo {
|
|||||||
|
|
||||||
var have int64
|
var have int64
|
||||||
for _, f := range m.remote[node] {
|
for _, f := range m.remote[node] {
|
||||||
if f.Equals(m.global[f.Name]) {
|
if f.Equals(m.global[f.Name]) && f.Flags&protocol.FlagDeleted == 0 {
|
||||||
have += f.Size
|
have += f.Size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -241,8 +243,10 @@ func (m *Model) InSyncSize() (files, bytes int64) {
|
|||||||
|
|
||||||
for n, f := range m.local {
|
for n, f := range m.local {
|
||||||
if gf, ok := m.global[n]; ok && f.Equals(gf) {
|
if gf, ok := m.global[n]; ok && f.Equals(gf) {
|
||||||
files++
|
if f.Flags&protocol.FlagDeleted == 0 {
|
||||||
bytes += f.Size
|
files++
|
||||||
|
bytes += f.Size
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user