协议密钥动态随机生成

This commit is contained in:
huangxiaolei
2022-11-28 23:36:57 +08:00
parent 362ca86130
commit 746435cf3c
22 changed files with 173 additions and 172 deletions

View File

@@ -2,7 +2,6 @@ package app
import (
"context"
"github.com/nats-io/nats.go"
_ "net/http/pprof"
"os"
"os/signal"
@@ -26,20 +25,6 @@ func Run(ctx context.Context, configFile string) error {
_ = controller.NewController(db)
// TODO 临时写一下用来传递新的密钥后面改RPC
conn, err := nats.Connect(config.CONF.MQ.NatsUrl)
if err != nil {
logger.LOG.Error("connect nats error: %v", err)
return nil
}
natsMsg := nats.NewMsg("GATE_KEY_HK4E")
natsMsg.Data = []byte{0x00, 0xff}
err = conn.PublishMsg(natsMsg)
if err != nil {
logger.LOG.Error("nats publish msg error: %v", err)
return nil
}
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
for {