We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
at hargo latest version and golang at 1.10.3 , func UpdateApp() has a deadly bug,
func (e *EurekaConnection) UpdateApp(app *Application) { go func() { for { log.Noticef("Updating app %s", app.Name) err := e.readAppInto(app) if err != nil { log.Errorf("Failure updating %s in goroutine", app.Name) } <-time.After(time.Duration(e.PollInterval) * time.Second) } }() }
func (e *EurekaConnection) UpdateApp(app *Application) {
go func() {
for {
log.Noticef("Updating app %s", app.Name)
err := e.readAppInto(app)
if err != nil {
log.Errorf("Failure updating %s in goroutine", app.Name)
}
<-time.After(time.Duration(e.PollInterval) * time.Second)
}()
func NewConnFromConfig(conf Config) (c EurekaConnection) { c.ServiceUrls = conf.Eureka.ServiceUrls c.ServicePort = conf.Eureka.ServerPort if len(c.ServiceUrls) == 0 && len(conf.Eureka.ServerDNSName) > 0 { c.ServiceUrls = []string{conf.Eureka.ServerDNSName} } c.Timeout = time.Duration(conf.Eureka.ConnectTimeoutSeconds) * time.Second c.PollInterval = time.Duration(conf.Eureka.PollIntervalSeconds) * time.Second c.PreferSameZone = conf.Eureka.PreferSameZone if conf.Eureka.UseDNSForServiceUrls { log.Warning("UseDNSForServiceUrls is an experimental option") c.DNSDiscovery = true c.DiscoveryZone = conf.Eureka.DNSDiscoveryZone c.ServerURLBase = conf.Eureka.ServerURLBase } return c }
func NewConnFromConfig(conf Config) (c EurekaConnection) {
c.ServiceUrls = conf.Eureka.ServiceUrls
c.ServicePort = conf.Eureka.ServerPort
if len(c.ServiceUrls) == 0 && len(conf.Eureka.ServerDNSName) > 0 {
c.ServiceUrls = []string{conf.Eureka.ServerDNSName}
c.Timeout = time.Duration(conf.Eureka.ConnectTimeoutSeconds) * time.Second
c.PollInterval = time.Duration(conf.Eureka.PollIntervalSeconds) * time.Second
c.PreferSameZone = conf.Eureka.PreferSameZone
if conf.Eureka.UseDNSForServiceUrls {
log.Warning("UseDNSForServiceUrls is an experimental option")
c.DNSDiscovery = true
c.DiscoveryZone = conf.Eureka.DNSDiscoveryZone
c.ServerURLBase = conf.Eureka.ServerURLBase
return c
The problem is <-time.After(time.Duration(e.PollInterval) * time.Second)
s := time.Duration(3) * time.Second k := time.Duration(s) * time.Second fmt.Println(s) fmt.Println(k) get 3s 833333h20m0s
s := time.Duration(3) * time.Second
k := time.Duration(s) * time.Second
fmt.Println(s)
fmt.Println(k)
get
3s
833333h20m0s
so , they will be fixed to <-time.After(time.Duration(e.PollInterval))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
at hargo latest version and golang at 1.10.3 , func UpdateApp() has a deadly bug,
func (e *EurekaConnection) UpdateApp(app *Application) {
go func() {
for {
log.Noticef("Updating app %s", app.Name)
err := e.readAppInto(app)
if err != nil {
log.Errorf("Failure updating %s in goroutine", app.Name)
}
<-time.After(time.Duration(e.PollInterval) * time.Second)
}
}()
}
func NewConnFromConfig(conf Config) (c EurekaConnection) {
c.ServiceUrls = conf.Eureka.ServiceUrls
c.ServicePort = conf.Eureka.ServerPort
if len(c.ServiceUrls) == 0 && len(conf.Eureka.ServerDNSName) > 0 {
c.ServiceUrls = []string{conf.Eureka.ServerDNSName}
}
c.Timeout = time.Duration(conf.Eureka.ConnectTimeoutSeconds) * time.Second
c.PollInterval = time.Duration(conf.Eureka.PollIntervalSeconds) * time.Second
c.PreferSameZone = conf.Eureka.PreferSameZone
if conf.Eureka.UseDNSForServiceUrls {
log.Warning("UseDNSForServiceUrls is an experimental option")
c.DNSDiscovery = true
c.DiscoveryZone = conf.Eureka.DNSDiscoveryZone
c.ServerURLBase = conf.Eureka.ServerURLBase
}
return c
}
The problem is <-time.After(time.Duration(e.PollInterval) * time.Second)
s := time.Duration(3) * time.Second
k := time.Duration(s) * time.Second
fmt.Println(s)
fmt.Println(k)
get
3s
833333h20m0s
so , they will be fixed to <-time.After(time.Duration(e.PollInterval))
The text was updated successfully, but these errors were encountered: