aboutsummaryrefslogtreecommitdiffhomepage
path: root/deploy
diff options
context:
space:
mode:
authordavidejones <[email protected]>2023-03-03 16:52:31 +0000
committerBjørn Erik Pedersen <[email protected]>2023-03-07 15:38:26 +0100
commite6f029bdeef4e1a719c5e77d51006b9007d96646 (patch)
tree361370d8b8afccb04a3738d9200f4ee70e41aa44 /deploy
parentbdbfacb86846237f968d790bc3819f81800afb08 (diff)
downloadhugo-e6f029bdeef4e1a719c5e77d51006b9007d96646.tar.gz
hugo-e6f029bdeef4e1a719c5e77d51006b9007d96646.zip
customize parallel transfer count
Diffstat (limited to 'deploy')
-rw-r--r--deploy/deploy.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/deploy/deploy.go b/deploy/deploy.go
index 5675d7aa0..e2a12ca7f 100644
--- a/deploy/deploy.go
+++ b/deploy/deploy.go
@@ -65,6 +65,7 @@ type Deployer struct {
force bool // true forces upload of all files
invalidateCDN bool // true enables invalidate CDN cache (if possible)
maxDeletes int // caps the # of files to delete; -1 to disable
+ transfers int // The number of file transfers to run in parallel
// For tests...
summary deploySummary // summary of latest Deploy results
@@ -118,6 +119,7 @@ func New(cfg config.Provider, localFs afero.Fs) (*Deployer, error) {
force: cfg.GetBool("force"),
invalidateCDN: cfg.GetBool("invalidateCDN"),
maxDeletes: cfg.GetInt("maxDeletes"),
+ transfers: cfg.GetInt("transfers"),
}, nil
}
@@ -189,7 +191,7 @@ func (d *Deployer) Deploy(ctx context.Context) error {
// Apply the changes in parallel, using an inverted worker
// pool (https://www.youtube.com/watch?v=5zXAHh5tJqQ&t=26m58s).
// sem prevents more than nParallel concurrent goroutines.
- const nParallel = 10
+ nParallel := d.transfers
var errs []error
var errMu sync.Mutex // protects errs