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

[BUG] apollo配置丢失 #84

Open
xuzhijvn opened this issue Nov 20, 2024 · 0 comments
Open

[BUG] apollo配置丢失 #84

xuzhijvn opened this issue Nov 20, 2024 · 0 comments

Comments

@xuzhijvn
Copy link

请简单描述bug的场景

apollo配置了如下两个key:

image

连接apollo获取配置:

	remote.SetAppID(global.CONFIG.Apollo.AppId)
	agolloOptions := []agollo.Option{
		agollo.AutoFetchOnCacheMiss(),
		agollo.FailTolerantOnBackupExists(),
		agollo.Cluster(global.CONFIG.Apollo.Cluster),
	}
	remote.SetAgolloOptions(agolloOptions...)
	v := viper.New()
	v.SetConfigType("prop")
	rp := defaultRemoteProvider{
		provider: "apollo",
		endpoint: global.CONFIG.Apollo.Endpoint,
		path:     "application",
	}
	err := v.AddRemoteProvider(rp.provider, rp.endpoint, rp.path)
	if err != nil {
		global.LOG.Error(err)
	}
	err = v.ReadRemoteConfig()
	if err != nil {
		global.LOG.Error(err)
	}

如上图,如果同时配置了key:a.b.c和a.b.c.d,viper只能随机拿到其中一个key(即:随机丢失了a.b.c或a.b.c.d其中一个)

期望
应该能同时拿到所有key

Agollo 版本 :

  • Version 1.2.14
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

1 participant