"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
accounting: deglobalize startTime/elapsedTime - fixes #5282
Chris Macklin35a86193b7c7
diff --git a/fs/accounting/stats.go b/fs/accounting/stats.goindex bb047ae84..8c6584d6c 100644--- a/fs/accounting/stats.go+++ b/fs/accounting/stats.go@@ -18,8 +18,6 @@ import (// MaxCompletedTransfers specifies maximum number of completed transfers in startedTransfers listvar MaxCompletedTransfers = 100-var startTime = time.Now()-// StatsInfo accounts all transferstype StatsInfo struct {mu sync.RWMutex@@ -49,6 +47,7 @@ type StatsInfo struct {oldTimeRanges timeRanges // a merged list of time ranges for the transfersoldDuration time.Duration // duration of transfers we have culledgroup string+ startTime time.Time // the moment these stats were initialized or reset}// NewStats creates an initialised StatsInfo@@ -60,6 +59,7 @@ func NewStats(ctx context.Context) *StatsInfo {checking: newTransferMap(ci.Checkers, "checking"),transferring: newTransferMap(ci.Transfers, "transferring"),inProgress: newInProgress(ctx),+ startTime: time.Now(),}}@@ -87,7 +87,7 @@ func (s *StatsInfo) RemoteStats() (out rc.Params, err error) {out["deletes"] = s.deletesout["deletedDirs"] = s.deletedDirsout["renames"] = s.renames- out["elapsedTime"] = time.Since(startTime).Seconds()+ out["elapsedTime"] = time.Since(s.startTime).Seconds()eta, etaOK := eta(s.bytes, ts.totalBytes, ts.speed)if etaOK {out["eta"] = eta.Seconds()@@ -298,7 +298,7 @@ func (s *StatsInfo) String() string {buf = &bytes.Buffer{}xfrchkString = ""dateString = ""- elapsedTime = time.Since(startTime)+ elapsedTime = time.Since(s.startTime)elapsedTimeSecondsOnly = elapsedTime.Truncate(time.Second/10) % time.MinutedisplaySpeedString string)