From f52245bec023e9af58544dc4d0a086d2ae9e3747 Mon Sep 17 00:00:00 2001 From: Benjamin Conn Date: Fri, 3 Nov 2023 10:06:19 -0700 Subject: [PATCH] redis --- autosocial/autosocial.go | 3 ++- cmd/lens_backfill/main.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/autosocial/autosocial.go b/autosocial/autosocial.go index daf761b4b..a8206d75e 100644 --- a/autosocial/autosocial.go +++ b/autosocial/autosocial.go @@ -17,6 +17,7 @@ import ( "github.com/mikeydub/go-gallery/service/lens" "github.com/mikeydub/go-gallery/service/logger" "github.com/mikeydub/go-gallery/service/persist/postgres" + "github.com/mikeydub/go-gallery/service/redis" "github.com/mikeydub/go-gallery/service/tracing" "github.com/mikeydub/go-gallery/util" ) @@ -43,7 +44,7 @@ func CoreInitServer(ctx context.Context) *gin.Engine { ney := farcaster.NewNeynarAPI(http.DefaultClient) router.Use(middleware.GinContextToContext(), middleware.Sentry(true), middleware.Tracing(), middleware.HandleCORS(), middleware.ErrLogger()) - router.POST("/process/users", processUsers(queries, ney, lens.NewAPI(http.DefaultClient))) + router.POST("/process/users", processUsers(queries, ney, lens.NewAPI(http.DefaultClient, redis.NewCache(redis.SocialCache)))) router.POST("/checkFarcasterApproval", checkFarcasterApproval(queries, ney)) return router } diff --git a/cmd/lens_backfill/main.go b/cmd/lens_backfill/main.go index 7de7a7e7e..8bc01a0ad 100644 --- a/cmd/lens_backfill/main.go +++ b/cmd/lens_backfill/main.go @@ -13,6 +13,7 @@ import ( "github.com/mikeydub/go-gallery/service/lens" "github.com/mikeydub/go-gallery/service/persist" "github.com/mikeydub/go-gallery/service/persist/postgres" + "github.com/mikeydub/go-gallery/service/redis" "github.com/mikeydub/go-gallery/util" "github.com/sirupsen/logrus" "github.com/sourcegraph/conc/pool" @@ -25,7 +26,7 @@ func main() { pg := postgres.NewPgxClient() - l := lens.NewAPI(&http.Client{Timeout: 10 * time.Second}) + l := lens.NewAPI(&http.Client{Timeout: 10 * time.Second}, redis.NewCache(redis.SocialCache)) queries := coredb.New(pg)