add caching for authors, expauthor type

This commit is contained in:
2023-02-21 21:37:43 -08:00
parent c9db6e38e4
commit 009c198cde
3 changed files with 42 additions and 4 deletions

View File

@@ -12,6 +12,10 @@ import (
)
func (paths RepoSet) GetRepoAuthors() ([]string, error) {
cache, ok := GetCachedReposAuthors(paths)
if ok {
return cache, nil
}
outChan := make(chan types.Commit, 10)
var wg sync.WaitGroup
for _, p := range paths {
@@ -45,6 +49,7 @@ func (paths RepoSet) GetRepoAuthors() ([]string, error) {
a = append(a, k)
}
sort.Strings(a)
CacheReposAuthors(paths, a)
return a, nil
}