Hey there! I've been trying to use the library in parallel to process several thousands of repositories but I've run into concurrent map read and write panics doing so, this PR fixes it.
getAllFiles is only used once in Analyze (and thus the whole process), so the file cache should be created inside that function and passed to the md5 checker function rather than being global.
Another option is to guard the global file cache with a mutex, but that's not ideal, since the cache would grow more and more as you call Analyze.
Hey there! I've been trying to use the library in parallel to process several thousands of repositories but I've run into
concurrent map read and write
panics doing so, this PR fixes it.getAllFiles
is only used once inAnalyze
(and thus the whole process), so the file cache should be created inside that function and passed to the md5 checker function rather than being global.Another option is to guard the global file cache with a mutex, but that's not ideal, since the cache would grow more and more as you call
Analyze
.