Chore: adjust HealthCheck at first check

This commit is contained in:
yaling888 2022-03-28 00:46:44 +08:00
parent 4502776513
commit 7e2c6e5188

View File

@ -31,7 +31,13 @@ type HealthCheck struct {
func (hc *HealthCheck) process() {
ticker := time.NewTicker(time.Duration(hc.interval) * time.Second)
go hc.check()
go func() {
t := time.NewTicker(30 * time.Second)
<-t.C
t.Stop()
hc.check()
}()
for {
select {
case <-ticker.C: