Skip to content

Commit 7af84bb

Browse files
authored
Merge pull request #180 from covexo/sync-improvements
Lock sync in recursive tar
2 parents b21bf85 + e89ee03 commit 7af84bb

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

pkg/devspace/sync/tar.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,19 +189,27 @@ func recursiveTar(basePath, relativePath string, writtenFiles map[string]*fileIn
189189
return nil
190190
}
191191

192+
config.fileIndex.fileMapMutex.Lock()
193+
isExcluded := false
194+
192195
// Exclude files on the exclude list
193196
if config.ignoreMatcher != nil {
194197
if config.ignoreMatcher.MatchesPath(relativePath) {
195-
return nil
198+
isExcluded = true
196199
}
197200
}
198201

199202
// Exclude files on the upload exclude list
200203
if config.uploadIgnoreMatcher != nil {
201204
if config.uploadIgnoreMatcher.MatchesPath(relativePath) {
202-
return nil
205+
isExcluded = true
203206
}
204207
}
208+
config.fileIndex.fileMapMutex.Unlock()
209+
210+
if isExcluded {
211+
return nil
212+
}
205213

206214
stat, err := os.Lstat(filepath)
207215

0 commit comments

Comments
 (0)