Make failed uploads not count as "Transferred" - fixes #708

This commit is contained in:
Nick Craig-Wood
2016-09-12 18:15:58 +01:00
parent 20a429c048
commit 83ba59749f
4 changed files with 20 additions and 9 deletions
+6 -2
View File
@@ -231,11 +231,15 @@ func (s *StatsInfo) Transferring(remote string) {
}
// DoneTransferring removes a transfer from the stats
func (s *StatsInfo) DoneTransferring(remote string) {
//
// if ok is true then it increments the transfers count
func (s *StatsInfo) DoneTransferring(remote string, ok bool) {
s.lock.Lock()
defer s.lock.Unlock()
delete(s.transferring, remote)
s.transfers++
if ok {
s.transfers++
}
}
// Account limits and accounts for one transfer