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

can not find apollo config!please confirm! #30

Closed
shaodahong opened this issue Nov 27, 2018 · 14 comments
Closed

can not find apollo config!please confirm! #30

shaodahong opened this issue Nov 27, 2018 · 14 comments
Assignees

Comments

@shaodahong
Copy link

shaodahong commented Nov 27, 2018

agollo.InitCustomConfig(func () (*agollo.AppConfig, error) {
	return &agollo.AppConfig{
		AppId:         "123",
		Cluster:       "456",
		Ip:            "ip",
		NamespaceName: "application",
	}, nil
)
agollo.Start()
@zouyx
Copy link
Member

zouyx commented Nov 29, 2018

你好,是否有在项目目录下增加app.properties的配置文件,具体配置文件可以参考:
https://github.com/zouyx/agollo/blob/master/app.properties

整体项目搭建可以参考:https://github.com/zouyx/agollo_demo

@shaodahong
Copy link
Author

app.properties在其他目录,不在项目目录里,我退到上个版本了,正常使用

@Gupern
Copy link

Gupern commented Jan 3, 2019

app.properties在其他目录,不在项目目录里,我退到上个版本了,正常使用

为什么上个版本就能正常使用?

@zouyx 请问能指定目录读取配置信息吗?或者像上个版本一样运行时指定配置?

@Gupern
Copy link

Gupern commented Jan 3, 2019

试了下,运行多次,InitCustomConfig后,有时成功有时不成功。是不是代码里更新配置相关的代码用了异步。

@zouyx
Copy link
Member

zouyx commented Jan 8, 2019

@Gupern 能否提供一下log?

@iammeizu
Copy link

iammeizu commented Jan 14, 2019

遇到了相同的问题,已在项目里添加配置信息,退到上个版本正常了

@zouyx
Copy link
Member

zouyx commented Jan 18, 2019

好的,我抽空看看,最近比较忙。

@lilonghe
Copy link

我 fork 之后把 app_config.go 第 225 行注释掉了...
测试了下貌似没有大问题

@zouyx
Copy link
Member

zouyx commented Mar 26, 2019

https://github.com/zouyx/agollo/blob/1c7741dd85847d375ba4f724f584e470900dc8ee/app_config.go#L225

225是这一行?能提一个pr我看看吗?不好意思,最近在有空- -让大家久等了

@lilonghe
Copy link

@zouyx 这个这个 因为不知道会不会有风险,所以还是你看下改了吧... 我就不提 pr 了

func syncServerIpList(newAppConfig *AppConfig) error{
	appConfig:=GetAppConfig(newAppConfig)
	if appConfig==nil{
		return nil
		// panic("can not find apollo config!please confirm!") <- 这个换成了 return nil 
	}

@zouyx zouyx self-assigned this Mar 27, 2019
@zouyx
Copy link
Member

zouyx commented Mar 27, 2019

@lilonghe ok,我试试看

@eddycjy
Copy link

eddycjy commented Mar 28, 2019

@zouyx 请问最近有打算修复吗?正打算接入...

@zouyx
Copy link
Member

zouyx commented Mar 29, 2019

@eddycjy 这周内解决

@zouyx zouyx closed this as completed in be3de00 Mar 29, 2019
zouyx added a commit that referenced this issue Mar 29, 2019
fixed #30 change initServerIpList to agollo.start()
@zouyx
Copy link
Member

zouyx commented Mar 29, 2019

@lilonghe @eddycjy 你们可以试试master或者v1.6.4,如有问题可以继续反馈或者提pr

zouyx added a commit that referenced this issue Aug 5, 2019
fixed #30 change initServerIpList to agollo.start()
zouyx added a commit that referenced this issue Aug 5, 2019
fixed #30 change initServerIpList to agollo.start()
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

6 participants