Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

seafile: use atomic types

Roberto Riccic624dd5c3aa9
diff --git a/backend/seafile/renew_test.go b/backend/seafile/renew_test.go
index 610f553fd..845693e44 100644
--- a/backend/seafile/renew_test.go
+++ b/backend/seafile/renew_test.go
@@ -17,17 +17,17 @@ func TestShouldAllowShutdownTwice(t *testing.T) {
}
func TestRenewalInTimeLimit(t *testing.T) {
- var count int64
+ var count atomic.Int64
renew := NewRenew(100*time.Millisecond, func() error {
- atomic.AddInt64(&count, 1)
+ count.Add(1)
return nil
})
time.Sleep(time.Second)
renew.Shutdown()
// there's no guarantee the CI agent can handle a simple goroutine
- renewCount := atomic.LoadInt64(&count)
+ renewCount := count.Load()
t.Logf("renew count = %d", renewCount)
assert.Greater(t, renewCount, int64(0))
assert.Less(t, renewCount, int64(11))