mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:41:44 +08: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.
|
||||
func (s *StatsInfo) NewCheckingTransfer(obj fs.Object) *Transfer {
|
||||
func (s *StatsInfo) NewCheckingTransfer(obj fs.DirEntry) *Transfer {
|
||||
tr := newCheckingTransfer(s, obj)
|
||||
s.checking.add(tr)
|
||||
return tr
|
||||
|
@ -697,7 +697,7 @@ func (s *StatsInfo) GetTransfers() int64 {
|
|||
}
|
||||
|
||||
// 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)
|
||||
s.transferring.add(tr)
|
||||
s.startAverageLoop()
|
||||
|
|
|
@ -63,12 +63,12 @@ type Transfer struct {
|
|||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user