Add concurrency level for parallel upload to dropbox.

This commit is contained in:
MaxJa4
2023-08-21 13:26:00 +02:00
parent 6362b322c2
commit 05c7a15e5b
3 changed files with 69 additions and 26 deletions

View File

@@ -72,6 +72,7 @@ type Config struct {
AzureStorageEndpoint string `split_words:"true" default:"https://{{ .AccountName }}.blob.core.windows.net/"`
DropboxToken string `split_words:"true"`
DropboxRemotePath string `split_words:"true"`
DropboxConcurrencyLevel int `split_words:"true" default:"2"`
}
func (c *Config) resolveSecret(envVar string, secretPath string) (string, error) {

View File

@@ -222,8 +222,9 @@ func newScript() (*script, error) {
if s.c.DropboxToken != "" {
dropboxConfig := dropbox.Config{
Token: s.c.DropboxToken,
RemotePath: s.c.DropboxRemotePath,
Token: s.c.DropboxToken,
RemotePath: s.c.DropboxRemotePath,
ConcurrencyLevel: s.c.DropboxConcurrencyLevel,
}
dropboxBackend, err := dropbox.NewStorageBackend(dropboxConfig, logFunc)
if err != nil {