"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
build: use the built-in min or max functions added in go1.21
Nick Craig-Wood5fd4ece31f24
diff --git a/backend/quatrix/upload_memory.go b/backend/quatrix/upload_memory.goindex 290c525da..9d802b8f9 100644--- a/backend/quatrix/upload_memory.go+++ b/backend/quatrix/upload_memory.go@@ -59,11 +59,7 @@ func (u *UploadMemoryManager) Consume(fileID string, neededMemory int64, speed fdefer func() { u.fileUsage[fileID] = borrowed }()- effectiveChunkSize := max(int64(speed*u.effectiveTime.Seconds()), u.reserved)-- if neededMemory < effectiveChunkSize {- effectiveChunkSize = neededMemory- }+ effectiveChunkSize := min(neededMemory, max(int64(speed*u.effectiveTime.Seconds()), u.reserved))if effectiveChunkSize <= u.reserved {return effectiveChunkSize