mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-13 06:47:30 +08:00
add gateway token-based node registration over host:port and shared nodes manager
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"clawgo/pkg/cron"
|
||||
"clawgo/pkg/heartbeat"
|
||||
"clawgo/pkg/logger"
|
||||
"clawgo/pkg/nodes"
|
||||
"clawgo/pkg/providers"
|
||||
"clawgo/pkg/runtimecfg"
|
||||
"clawgo/pkg/sentinel"
|
||||
@@ -176,6 +177,13 @@ func gatewayCmd() {
|
||||
fmt.Printf("Error starting channels: %v\n", err)
|
||||
}
|
||||
|
||||
registryServer := nodes.NewRegistryServer(cfg.Gateway.Host, cfg.Gateway.Port, cfg.Gateway.Token, nodes.DefaultManager())
|
||||
if err := registryServer.Start(ctx); err != nil {
|
||||
fmt.Printf("Error starting node registry server: %v\n", err)
|
||||
} else {
|
||||
fmt.Printf("✓ Node registry server started on %s:%d\n", cfg.Gateway.Host, cfg.Gateway.Port)
|
||||
}
|
||||
|
||||
go agentLoop.Run(ctx)
|
||||
go runGatewayStartupCompactionCheck(ctx, agentLoop)
|
||||
go runGatewayBootstrapInit(ctx, cfg, agentLoop)
|
||||
|
||||
Reference in New Issue
Block a user