Hash out a config value, default to 3 for now
This commit is contained in:
parent
88b5de3f1b
commit
7fcdb6c992
@ -110,7 +110,7 @@ func pushCommand(cmd *cobra.Command, args []string) {
|
||||
Panic(err, "Error scanning for Git LFS files")
|
||||
}
|
||||
|
||||
uploadQueue := lfs.NewUploadQueue(3)
|
||||
uploadQueue := lfs.NewUploadQueue(lfs.Config.ConcurrentUploads())
|
||||
|
||||
for i, pointer := range pointers {
|
||||
if dryRun {
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
@ -69,6 +70,19 @@ func (c *Configuration) Endpoint() Endpoint {
|
||||
return c.RemoteEndpoint(defaultRemote)
|
||||
}
|
||||
|
||||
func (c *Configuration) ConcurrentUploads() int {
|
||||
uploads := 3
|
||||
|
||||
if v, ok := c.GitConfig("lfs.concurrentuploads"); ok {
|
||||
n, err := strconv.Atoi(v)
|
||||
if err == nil {
|
||||
uploads = n
|
||||
}
|
||||
}
|
||||
|
||||
return uploads
|
||||
}
|
||||
|
||||
func (c *Configuration) RemoteEndpoint(remote string) Endpoint {
|
||||
if len(remote) == 0 {
|
||||
remote = defaultRemote
|
||||
|
Loading…
Reference in New Issue
Block a user