diff options
author | Frédéric Guillot <fred@miniflux.net> | 2019-06-01 18:18:09 -0700 |
---|---|---|
committer | fguillot <fred@miniflux.net> | 2019-06-02 06:30:08 -0700 |
commit | 228862fefaa645026caa483ffe9993bf8c00b22e (patch) | |
tree | 2b590dc6cda3e50928a31ce673641357805f75ce /fever | |
parent | 04d85b3c63afcf6c9539fc8dc7a91c4e36c2e8fb (diff) |
Refactor config package
- Parse configuration only once during startup time
- Store configuration values in a global variable
Diffstat (limited to 'fever')
-rw-r--r-- | fever/handler.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fever/handler.go b/fever/handler.go index 95d0a44..869e621 100644 --- a/fever/handler.go +++ b/fever/handler.go @@ -10,7 +10,6 @@ import ( "strings" "time" - "miniflux.app/config" "miniflux.app/http/request" "miniflux.app/http/response/json" "miniflux.app/integration" @@ -22,8 +21,8 @@ import ( ) // Serve handles Fever API calls. -func Serve(router *mux.Router, cfg *config.Config, store *storage.Storage) { - handler := &handler{cfg, store} +func Serve(router *mux.Router, store *storage.Storage) { + handler := &handler{store} sr := router.PathPrefix("/fever").Subrouter() sr.Use(newMiddleware(store).serve) @@ -31,7 +30,6 @@ func Serve(router *mux.Router, cfg *config.Config, store *storage.Storage) { } type handler struct { - cfg *config.Config store *storage.Storage } @@ -424,7 +422,7 @@ func (h *handler) handleWriteItems(w http.ResponseWriter, r *http.Request) { } go func() { - integration.SendEntry(h.cfg, entry, settings) + integration.SendEntry(entry, settings) }() } |