diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-09-21 17:17:03 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-09-22 13:08:27 +0300 |
commit | 079f5e979142bceeeb6506c4d31d7c9f1488ce78 (patch) | |
tree | 1d0f83071f8978594dbe1a7c43b3d112f6073839 /app.go | |
parent | e33a670211b5a63b5db4c024b95ec2d96d2ef463 (diff) |
Separate domain config source from a domain
Diffstat (limited to 'app.go')
-rw-r--r-- | app.go | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -28,6 +28,7 @@ import ( "gitlab.com/gitlab-org/gitlab-pages/internal/logging" "gitlab.com/gitlab-org/gitlab-pages/internal/netutil" "gitlab.com/gitlab-org/gitlab-pages/internal/request" + "gitlab.com/gitlab-org/gitlab-pages/internal/source/dirs" ) const ( @@ -47,7 +48,7 @@ var ( type theApp struct { appConfig - dm domain.Map + dm dirs.Map lock sync.RWMutex Artifact *artifact.Artifact Auth *auth.Auth @@ -322,7 +323,7 @@ func (a *theApp) buildHandlerPipeline() (http.Handler, error) { return handler, nil } -func (a *theApp) UpdateDomains(dm domain.Map) { +func (a *theApp) UpdateDomains(dm dirs.Map) { a.lock.Lock() defer a.lock.Unlock() a.dm = dm @@ -366,7 +367,7 @@ func (a *theApp) Run() { a.listenAdminUnix(&wg) a.listenAdminHTTPS(&wg) - go domain.Watch(a.Domain, a.UpdateDomains, time.Second) + go dirs.Watch(a.Domain, a.UpdateDomains, time.Second) wg.Wait() } |