添加了节点服务器,各个服务器之间支持多对多

This commit is contained in:
flswld
2022-12-24 04:14:33 +08:00
parent 16dd9c1e87
commit 7e86669628
92 changed files with 1429 additions and 287 deletions

View File

@@ -9,6 +9,7 @@ import (
"time"
"hk4e/common/config"
"hk4e/common/rpc"
"hk4e/dispatch/controller"
"hk4e/dispatch/dao"
"hk4e/pkg/logger"
@@ -23,7 +24,12 @@ func Run(ctx context.Context, configFile string) error {
db := dao.NewDao()
defer db.CloseDao()
_ = controller.NewController(db)
client, err := rpc.NewClient()
if err != nil {
return err
}
_ = controller.NewController(db, client.Discovery)
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)