Skip to content

Commit 0b412d7

Browse files
committed
refactor: do not clone git repos in parallel
1 parent a8201e2 commit 0b412d7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • pkg/devspace/dependency/util

pkg/devspace/dependency/util/util.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os"
99
"path/filepath"
1010
"strings"
11+
"sync"
1112

1213
"github.com/loft-sh/devspace/pkg/util/encoding"
1314

@@ -32,7 +33,13 @@ func init() {
3233
DependencyFolderPath = filepath.Join(homedir, filepath.FromSlash(DependencyFolder))
3334
}
3435

36+
// downloadMutex makes sure we only download a single dependency at a time
37+
var downloadMutex = sync.Mutex{}
38+
3539
func DownloadDependency(ctx context.Context, workingDirectory string, source *latest.SourceConfig, log log.Logger) (configPath string, err error) {
40+
downloadMutex.Lock()
41+
defer downloadMutex.Unlock()
42+
3643
ID, err := GetDependencyID(source)
3744
if err != nil {
3845
return "", err

0 commit comments

Comments
 (0)