系统优化

This commit is contained in:
hahwu 2025-03-19 15:44:50 +08:00
parent 32e37f5bd4
commit 8325ce66f2
3 changed files with 4 additions and 5 deletions

View File

@ -47,6 +47,7 @@ var Server struct {
GameConfPath string
TELOGDIR string
GoogleVerify bool
Partition int
}
func init() {

View File

@ -30,6 +30,6 @@
"RedisPwd" :"",
"GoogleVerify":true,
"RemoteAddr":"host.docker.internal:9001"
"RemoteAddr":"host.docker.internal:9001",
"Partition":1
}

View File

@ -14,10 +14,8 @@ var topic string
func init() {
topic = conf.Server.GameName
partition := 0
// 连接至Kafka集群的Leader节点
conn, err := kafka.DialLeader(context.Background(), "tcp", "kafka-server:9092", topic, partition)
conn, err := kafka.DialLeader(context.Background(), "tcp", "kafka-server:9092", topic, conf.Server.Partition)
if err != nil {
log.Debug("kafka.DialLeader err: %v", err)
go reconnectKafka()