"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
stats: use appropriate Lock func's
Fabian Möller9c90b5e77c9a
diff --git a/fs/accounting/stats.go b/fs/accounting/stats.goindex ca0f3084c..c16f46bdb 100644--- a/fs/accounting/stats.go+++ b/fs/accounting/stats.go@@ -102,8 +102,8 @@ func (s *StatsInfo) Bytes(bytes int64) {// GetBytes returns the number of bytes transferred so farfunc (s *StatsInfo) GetBytes() int64 {- s.mu.Lock()- defer s.mu.Unlock()+ s.mu.RLock()+ defer s.mu.RUnlock()return s.bytes}@@ -138,8 +138,8 @@ func (s *StatsInfo) Deletes(deletes int64) int64 {// ResetCounters sets the counters (bytes, checks, errors, transfers) to 0func (s *StatsInfo) ResetCounters() {- s.mu.RLock()- defer s.mu.RUnlock()+ s.mu.Lock()+ defer s.mu.Unlock()s.bytes = 0s.errors = 0s.checks = 0@@ -149,8 +149,8 @@ func (s *StatsInfo) ResetCounters() {// ResetErrors sets the errors count to 0func (s *StatsInfo) ResetErrors() {- s.mu.RLock()- defer s.mu.RUnlock()+ s.mu.Lock()+ defer s.mu.Unlock()s.errors = 0}