force limit core log rate

This commit is contained in:
arm64v8a
2023-05-16 09:45:50 +09:00
parent 07aaf401e4
commit a4b5656dc5
9 changed files with 28 additions and 21 deletions

View File

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