aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/index
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/index')
-rw-r--r--pkg/index/index.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/index/index.go b/pkg/index/index.go
index 35423bd..f3dc00d 100644
--- a/pkg/index/index.go
+++ b/pkg/index/index.go
@@ -55,9 +55,18 @@ func (s *SiteIndex) AddSite(site *site.Site) {
s.updateSiteIndexes()
}
+func (s *SiteIndex) UpdateSiteIndexes() {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+
+ s.updateSiteIndexes()
+}
+
func (s *SiteIndex) updateSiteIndexes() {
clear(s.sitesByHost)
for _, site := range s.sites {
- s.sitesByHost[site.SiteConfig.Host] = site
+ if site.SiteConfig.Host != "" {
+ s.sitesByHost[site.SiteConfig.Host] = site
+ }
}
}