cherry-game / cherry

Actor model game server framework based on golang

Home Page:https://cherry-game.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[suggestion] cherry.go 中的startup 方法建议将服务发现和集群创建的方法调换下位置

huangweiboy2 opened this issue · comments

旧代码:

if app.NodeMode() == Cluster {
cluster := ccluster.New()
app.SetCluster(cluster)
app.Register(cluster)

discovery := cdiscovery.New()
app.SetDiscovery(discovery)
app.Register(discovery)

}

新代码:

if app.NodeMode() == Cluster {
discovery := cdiscovery.New()
app.SetDiscovery(discovery)
app.Register(discovery)

	cluster := ccluster.New()
	app.SetCluster(cluster)
	app.Register(cluster)
}

好像没有什么影响吧