merge with master

This commit is contained in:
Tan Jiang 2016-06-28 18:40:12 +08:00
commit 523eacef86

View File

@ -60,17 +60,19 @@ func RefreshCatalogCache() error {
if err != nil { if err != nil {
return err return err
} }
/*
repos := []string{} repos := []string{}
for _, repo := range rs { for _, repo := range rs {
rc, err := NewRepositoryClient(endpoint, true, username, rc, ok := repositoryClients[repo]
repo, "repository", repo, "pull", "push", "*") if !ok {
rc, err = registry.NewRepositoryWithUsername(repo, endpoint, username)
if err != nil { if err != nil {
log.Errorf("error occurred while initializing repository client used by cache: %s %v", repo, err) log.Errorf("error occurred while initializing repository client used by cache: %s %v", repo, err)
continue continue
} }
repositoryClients[repo] = rc
}
tags, err := rc.ListTag() tags, err := rc.ListTag()
if err != nil { if err != nil {
log.Errorf("error occurred while list tag for %s: %v", repo, err) log.Errorf("error occurred while list tag for %s: %v", repo, err)
@ -82,8 +84,9 @@ func RefreshCatalogCache() error {
log.Debugf("add %s to catalog cache", 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 return nil
} }