Skip to content

Commit

Permalink
fixed Storer disconnect errors
Browse files Browse the repository at this point in the history
  • Loading branch information
EricFrancis12 committed Jul 22, 2024
1 parent 11625b8 commit 9b7a68c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
migrate:
migrate dev:
npx prisma migrate dev

seed:
Expand Down
2 changes: 0 additions & 2 deletions api/click.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ var clickStorer = pkg.NewStorer()

func Click(w http.ResponseWriter, r *http.Request) {
timestamp, ctx := clickStorer.InitVisit(r)
defer clickStorer.Client.Disconnect()
defer clickStorer.Cache.Close()

clickPublicId := getCookieValue(r, pkg.CookieNameClickPublicID)
if clickPublicId == "" {
Expand Down
2 changes: 0 additions & 2 deletions api/postback.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ type PostbackResp struct{}

func Postback(w http.ResponseWriter, r *http.Request) {
timestamp, ctx := postbackStorer.InitVisit(r)
defer postbackStorer.Client.Disconnect()
defer postbackStorer.Cache.Close()

if clickPublicId := r.URL.Query().Get("pid"); clickPublicId != "" {
// Get click from db
Expand Down
2 changes: 0 additions & 2 deletions api/t.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ var tStorer = pkg.NewStorer()

func T(w http.ResponseWriter, r *http.Request) {
timestamp, ctx := tStorer.InitVisit(r)
defer tStorer.Client.Disconnect()
defer tStorer.Cache.Close()

g := getGValue(r)
if g == "" {
Expand Down

0 comments on commit 9b7a68c

Please sign in to comment.