mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-07 11:38:07 +02:00
Merge pull request #434 from reasonerjt/master
do not scan for tags while refreshing cache
This commit is contained in:
commit
af1db227d9
@ -66,32 +66,33 @@ func RefreshCatalogCache() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
/*
|
||||
repos := []string{}
|
||||
|
||||
repos := []string{}
|
||||
|
||||
for _, repo := range rs {
|
||||
rc, ok := repositoryClients[repo]
|
||||
if !ok {
|
||||
rc, err = registry.NewRepositoryWithUsername(repo, endpoint, username)
|
||||
for _, repo := range rs {
|
||||
rc, ok := repositoryClients[repo]
|
||||
if !ok {
|
||||
rc, err = registry.NewRepositoryWithUsername(repo, endpoint, username)
|
||||
if err != nil {
|
||||
log.Errorf("error occurred while initializing repository client used by cache: %s %v", repo, err)
|
||||
continue
|
||||
}
|
||||
repositoryClients[repo] = rc
|
||||
}
|
||||
tags, err := rc.ListTag()
|
||||
if err != nil {
|
||||
log.Errorf("error occurred while initializing repository client used by cache: %s %v", repo, err)
|
||||
log.Errorf("error occurred while list tag for %s: %v", repo, err)
|
||||
continue
|
||||
}
|
||||
repositoryClients[repo] = rc
|
||||
}
|
||||
tags, err := rc.ListTag()
|
||||
if err != nil {
|
||||
log.Errorf("error occurred while list tag for %s: %v", repo, err)
|
||||
continue
|
||||
}
|
||||
|
||||
if len(tags) != 0 {
|
||||
repos = append(repos, repo)
|
||||
log.Debugf("add %s to catalog cache", repo)
|
||||
if len(tags) != 0 {
|
||||
repos = append(repos, repo)
|
||||
log.Debugf("add %s to catalog cache", repo)
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
Cache.Put(catalogKey, repos, 600*time.Second)
|
||||
Cache.Put(catalogKey, rs, 600*time.Second)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user