publish: don't retain a blobserver.Loader, just a FindHandlerByTyper

Change-Id: I37d5873ce4c30f67841f31fa744afaf80b24d4b3
This commit is contained in:
Brad Fitzpatrick 2013-01-11 10:14:18 -08:00
parent d80cad8e2d
commit 5998fecc22
1 changed files with 3 additions and 3 deletions

View File

@ -51,7 +51,7 @@ type PublishHandler struct {
JSFiles, CSSFiles []string JSFiles, CSSFiles []string
bsLoader blobserver.Loader handlerFinder blobserver.FindHandlerByTyper
staticHandler http.Handler staticHandler http.Handler
} }
@ -61,7 +61,7 @@ func init() {
func newPublishFromConfig(ld blobserver.Loader, conf jsonconfig.Obj) (h http.Handler, err error) { func newPublishFromConfig(ld blobserver.Loader, conf jsonconfig.Obj) (h http.Handler, err error) {
ph := &PublishHandler{ ph := &PublishHandler{
bsLoader: ld, handlerFinder: ld,
} }
ph.RootName = conf.RequiredString("rootName") ph.RootName = conf.RequiredString("rootName")
ph.JSFiles = conf.OptionalList("js") ph.JSFiles = conf.OptionalList("js")
@ -178,7 +178,7 @@ func (ph *PublishHandler) serveDiscovery(rw http.ResponseWriter, req *http.Reque
}) })
return return
} }
_, handler, err := ph.bsLoader.FindHandlerByType("ui") _, handler, err := ph.handlerFinder.FindHandlerByType("ui")
if err != nil { if err != nil {
discoveryHelper(rw, req, map[string]interface{}{ discoveryHelper(rw, req, map[string]interface{}{
"error": "no admin handler running", "error": "no admin handler running",