mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
force limit core log rate
This commit is contained in:
@@ -17,9 +17,12 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/matsuridayo/libneko/neko_common"
|
||||
"github.com/matsuridayo/libneko/neko_log"
|
||||
|
||||
grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"golang.org/x/time/rate"
|
||||
)
|
||||
|
||||
type BaseServer struct {
|
||||
@@ -41,6 +44,8 @@ func RunCore(setupCore func(), server gen.LibcoreServiceServer) {
|
||||
flag.CommandLine.Parse(os.Args[2:])
|
||||
|
||||
neko_common.Debug = *_debug
|
||||
neko_log.RateLimiter = rate.NewLimiter(rate.Limit(100), 150)
|
||||
neko_log.RateLimitExit = true
|
||||
|
||||
go func() {
|
||||
parent, err := os.FindProcess(os.Getppid())
|
||||
|
||||
Reference in New Issue
Block a user