diff --git a/cmd/panel/main.go b/cmd/panel/main.go index 08155c0..8e34cb1 100644 --- a/cmd/panel/main.go +++ b/cmd/panel/main.go @@ -10,8 +10,10 @@ import ( "github.com/TicketsBot/GoPanel/database" "github.com/TicketsBot/GoPanel/messagequeue" "github.com/TicketsBot/GoPanel/rpc/cache" + "github.com/TicketsBot/GoPanel/rpc/ratelimit" "github.com/TicketsBot/GoPanel/utils" "github.com/apex/log" + gdlratelimit "github.com/rxdn/gdl/rest/ratelimit" "math/rand" "time" ) @@ -35,6 +37,8 @@ func main() { messagequeue.Client = messagequeue.NewRedisClient() go Listen(messagequeue.Client) + ratelimit.Ratelimiter = gdlratelimit.NewRateLimiter(gdlratelimit.NewRedisStore(messagequeue.Client.Client, "ratelimit")) // TODO: Use values from config + http.StartServer() } diff --git a/rpc/ratelimit/ratelimit.go b/rpc/ratelimit/ratelimit.go index 72a00c6..876f6dc 100644 --- a/rpc/ratelimit/ratelimit.go +++ b/rpc/ratelimit/ratelimit.go @@ -1,8 +1,7 @@ package ratelimit import ( - "github.com/TicketsBot/GoPanel/messagequeue" "github.com/rxdn/gdl/rest/ratelimit" ) -var Ratelimiter = ratelimit.NewRateLimiter(ratelimit.NewRedisStore(messagequeue.Client.Client, "ratelimit")) // TODO: Use values from config +var Ratelimiter *ratelimit.Ratelimiter