Change unique values to hits values
This commit is contained in:
2
go.mod
2
go.mod
@@ -4,7 +4,7 @@ go 1.18
|
||||
|
||||
require (
|
||||
github.com/gofiber/fiber/v2 v2.37.0
|
||||
github.com/mcstatus-io/shared v0.0.0-20221022211501-c2159792b379
|
||||
github.com/mcstatus-io/shared v0.0.0-20221023001202-042a64f3e9a8
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
|
||||
2
go.sum
2
go.sum
@@ -24,6 +24,8 @@ github.com/mcstatus-io/shared v0.0.0-20221022211244-6945f6f4202e h1:IQcYQuxOLlur
|
||||
github.com/mcstatus-io/shared v0.0.0-20221022211244-6945f6f4202e/go.mod h1:0CPc1P/GzYKF3mS7CkRP3Mo/uOjU4fmZVkm0AF1c6D8=
|
||||
github.com/mcstatus-io/shared v0.0.0-20221022211501-c2159792b379 h1:CpddEJRMAvbc0kUedMk3A2VMl4SAb6u3HKMn66eThuA=
|
||||
github.com/mcstatus-io/shared v0.0.0-20221022211501-c2159792b379/go.mod h1:0CPc1P/GzYKF3mS7CkRP3Mo/uOjU4fmZVkm0AF1c6D8=
|
||||
github.com/mcstatus-io/shared v0.0.0-20221023001202-042a64f3e9a8 h1:rELiwobCe1cWY6Plr3oArLYAPh41hZw1JvZz4h4Pvbw=
|
||||
github.com/mcstatus-io/shared v0.0.0-20221023001202-042a64f3e9a8/go.mod h1:0CPc1P/GzYKF3mS7CkRP3Mo/uOjU4fmZVkm0AF1c6D8=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
|
||||
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/mcstatus-io/shared/status"
|
||||
@@ -31,7 +30,7 @@ func JavaStatusHandler(ctx *fiber.Ctx) error {
|
||||
return ctx.Status(http.StatusBadRequest).SendString("Invalid address value")
|
||||
}
|
||||
|
||||
if err = r.Set(fmt.Sprintf("unique:%s-%d", host, port), time.Now(), 0); err != nil {
|
||||
if err = r.Increment(fmt.Sprintf("java-hits:%s-%d", host, port)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -55,7 +54,7 @@ func BedrockStatusHandler(ctx *fiber.Ctx) error {
|
||||
return ctx.Status(http.StatusBadRequest).SendString("Invalid address value")
|
||||
}
|
||||
|
||||
if err = r.Set(fmt.Sprintf("unique:%s-%d", host, port), time.Now(), 0); err != nil {
|
||||
if err = r.Increment(fmt.Sprintf("bedrock-hits:%s-%d", host, port)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user