mirror of
https://github.com/rclone/rclone.git
synced 2024-12-22 23:22:08 +01:00
accounting: make it so we can account directories as well as files
This commit is contained in:
parent
919e28b8bf
commit
47b04580db
@ -675,7 +675,7 @@ func (s *StatsInfo) RetryAfter() time.Time {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewCheckingTransfer adds a checking transfer to the stats, from the object.
|
// NewCheckingTransfer adds a checking transfer to the stats, from the object.
|
||||||
func (s *StatsInfo) NewCheckingTransfer(obj fs.Object) *Transfer {
|
func (s *StatsInfo) NewCheckingTransfer(obj fs.DirEntry) *Transfer {
|
||||||
tr := newCheckingTransfer(s, obj)
|
tr := newCheckingTransfer(s, obj)
|
||||||
s.checking.add(tr)
|
s.checking.add(tr)
|
||||||
return tr
|
return tr
|
||||||
@ -697,7 +697,7 @@ func (s *StatsInfo) GetTransfers() int64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewTransfer adds a transfer to the stats from the object.
|
// NewTransfer adds a transfer to the stats from the object.
|
||||||
func (s *StatsInfo) NewTransfer(obj fs.Object) *Transfer {
|
func (s *StatsInfo) NewTransfer(obj fs.DirEntry) *Transfer {
|
||||||
tr := newTransfer(s, obj)
|
tr := newTransfer(s, obj)
|
||||||
s.transferring.add(tr)
|
s.transferring.add(tr)
|
||||||
s.startAverageLoop()
|
s.startAverageLoop()
|
||||||
|
@ -63,12 +63,12 @@ type Transfer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// newCheckingTransfer instantiates new checking of the object.
|
// newCheckingTransfer instantiates new checking of the object.
|
||||||
func newCheckingTransfer(stats *StatsInfo, obj fs.Object) *Transfer {
|
func newCheckingTransfer(stats *StatsInfo, obj fs.DirEntry) *Transfer {
|
||||||
return newTransferRemoteSize(stats, obj.Remote(), obj.Size(), true)
|
return newTransferRemoteSize(stats, obj.Remote(), obj.Size(), true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// newTransfer instantiates new transfer.
|
// newTransfer instantiates new transfer.
|
||||||
func newTransfer(stats *StatsInfo, obj fs.Object) *Transfer {
|
func newTransfer(stats *StatsInfo, obj fs.DirEntry) *Transfer {
|
||||||
return newTransferRemoteSize(stats, obj.Remote(), obj.Size(), false)
|
return newTransferRemoteSize(stats, obj.Remote(), obj.Size(), false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user