fix panic

This commit is contained in:
Dot-Rar 2020-04-14 17:33:13 +01:00
parent 7dab620b1a
commit fa8fb824da
2 changed files with 5 additions and 2 deletions

View File

@ -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()
}

View File

@ -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