mirror of
https://github.com/dragonheim/gagent.git
synced 2025-04-26 02:18:59 -07:00
refactor: cleaning up some old issues and stndardizing.
This commit is contained in:
parent
b95d3950c5
commit
8640d42132
6 changed files with 190 additions and 113 deletions
|
@ -7,8 +7,8 @@ type GagentConfig struct {
|
|||
Name string `hcl:"name,optional"`
|
||||
Mode string `hcl:"mode,attr"`
|
||||
UUID string `hcl:"uuid,optional"`
|
||||
MonitorPort int `hcl:"monitorport,optional"`
|
||||
ListenAddr string `hcl:"listenaddr,optional"`
|
||||
MonitorPort int64 `hcl:"monitorport,optional"`
|
||||
ClientPort int64 `hcl:"clientport,optional"`
|
||||
RouterPort int64 `hcl:"routerport,optional"`
|
||||
WorkerPort int64 `hcl:"workerport,optional"`
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package worker
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
log "log"
|
||||
strconv "strconv"
|
||||
sync "sync"
|
||||
|
||||
gstructs "github.com/dragonheim/gagent/internal/gstructs"
|
||||
|
@ -43,13 +43,13 @@ func Main(wg *sync.WaitGroup, config gstructs.GagentConfig) {
|
|||
/*
|
||||
* Generate connect string for this router.
|
||||
*/
|
||||
connectString := fmt.Sprintf("tcp://%s:%d", config.Routers[key].RouterAddr, rport)
|
||||
connectString := "tcp://" + config.Routers[key].RouterAddr + ":" + strconv.FormatInt(rport, 10)
|
||||
|
||||
wg.Add(1)
|
||||
go getAgent(wg, config.UUID, connectString)
|
||||
}
|
||||
/*
|
||||
* workerListener := fmt.Sprintf("tcp://%s:%d", config.ListenAddr, config.WorkerPort)
|
||||
* workerListener := "tcp://" + config.ListenAddr + ":" + strconv.FormatInt(config.WorkerPort, 10)
|
||||
*/
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue