From 228862fefaa645026caa483ffe9993bf8c00b22e Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 1 Jun 2019 18:18:09 -0700 Subject: Refactor config package - Parse configuration only once during startup time - Store configuration values in a global variable --- fever/handler.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'fever') 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) }() } -- cgit v1.2.3