Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gorose.Open读取文件配置时,会默认走集群配置的解析。 #65

Closed
sth4me opened this issue Jan 3, 2019 · 1 comment
Closed

Comments

@sth4me
Copy link

sth4me commented Jan 3, 2019

        if strings.Contains(strFp, "Slave") &&
		strings.Contains(strFp, "Master") {
		err = json.Unmarshal(fp, dbConfCluster)
	} else {
		//err = json.Unmarshal([]byte(fp), &conf.Master)
		err = jsonDecoder(fp, dbConfCluster) //即使配置文件设置的单一服务器配置,也会通过反射解析集群配置报错
	}

建议要么定死配置文件格式,将slave留空,要么这里的代码改成单一配置的interface。

@fizzday
Copy link
Member

fizzday commented Feb 20, 2019

这里的集群是为了兼容, 最后执行的时候, 会优先做判定, 单个配置, 会自动转换成集群配置, 单个配置也是集群的一种, 只不过是只有一个服务而已, 并不冲突

@fizzday fizzday closed this as completed Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants