From c1c1bb2c4c1baf37dbcce96f144966d4ada65ac5 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Mon, 23 Jan 2023 22:30:30 +0100 Subject: Implement cache and logger middlewares for gemini --- src/cmd/mediocre-blog/main.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/cmd') diff --git a/src/cmd/mediocre-blog/main.go b/src/cmd/mediocre-blog/main.go index ff8e478..d6a6b56 100644 --- a/src/cmd/mediocre-blog/main.go +++ b/src/cmd/mediocre-blog/main.go @@ -7,6 +7,7 @@ import ( "syscall" "time" + "github.com/mediocregopher/blog.mediocregopher.com/srv/cache" cfgpkg "github.com/mediocregopher/blog.mediocregopher.com/srv/cfg" "github.com/mediocregopher/blog.mediocregopher.com/srv/gmi" "github.com/mediocregopher/blog.mediocregopher.com/srv/http" @@ -102,7 +103,10 @@ func main() { postAssetStore := post.NewAssetStore(postSQLDB) postDraftStore := post.NewDraftStore(postSQLDB) + cache := cache.New(5000) + httpParams.Logger = logger.WithNamespace("http") + httpParams.Cache = cache httpParams.PowManager = powMgr httpParams.PostStore = postStore httpParams.PostAssetStore = postAssetStore @@ -124,6 +128,7 @@ func main() { }() gmiParams.Logger = logger.WithNamespace("gmi") + gmiParams.Cache = cache gmiParams.PostStore = postStore gmiParams.PostAssetStore = postAssetStore gmiParams.HTTPPublicURL = httpParams.PublicURL -- cgit v1.2.3