Skip to content

Commit

Permalink
redis
Browse files Browse the repository at this point in the history
  • Loading branch information
benny-conn committed Nov 3, 2023
1 parent 1c098b2 commit f52245b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion autosocial/autosocial.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/lens_backfill/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)

Expand Down

0 comments on commit f52245b

Please sign in to comment.