Improve server start handling to avoid service failure due to timeout.

This commit is contained in:
GRMrGecko 2025-01-08 13:12:31 -06:00
parent 88f8e88805
commit b0de9be277
3 changed files with 9 additions and 16 deletions

Binary file not shown.

View File

@ -36,16 +36,6 @@ type Listener struct {
log *log.Entry log *log.Entry
} }
// Check if IP address is all zero.
func isZeroAddr(ip net.IP) bool {
for _, b := range ip {
if b != 0x0 {
return false
}
}
return true
}
// Make a new listener on the specified address. This // Make a new listener on the specified address. This
// listener is added to the app listener list, and errors // listener is added to the app listener list, and errors
// on existing listeners for the specified address. // on existing listeners for the specified address.

View File

@ -47,12 +47,15 @@ func (a *ServerCmd) Run() error {
return err return err
} }
// Apply the configuration read. // Apply the configuration in the background, to allow service start to notify
err = ApplyConfig(config) // the service managers fast.
// If error applying the config, we should fail. go func() {
if err != nil { err = ApplyConfig(config)
return err // If error applying the config, log.
} if err != nil {
log.Println("An error occurred applying configuration:", err)
}
}()
} }
// Send notification that the service is ready. // Send notification that the service is ready.