mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
fix health check bug, fix #1367
This commit is contained in:
parent
b657c0fe09
commit
757b3613fe
@ -96,12 +96,12 @@ func (monitor *HealthCheckMonitor) Stop() {
|
|||||||
|
|
||||||
func (monitor *HealthCheckMonitor) checkWorker() {
|
func (monitor *HealthCheckMonitor) checkWorker() {
|
||||||
for {
|
for {
|
||||||
ctx, cancel := context.WithDeadline(monitor.ctx, time.Now().Add(monitor.timeout))
|
doCtx, cancel := context.WithDeadline(monitor.ctx, time.Now().Add(monitor.timeout))
|
||||||
err := monitor.doCheck(ctx)
|
err := monitor.doCheck(doCtx)
|
||||||
|
|
||||||
// check if this monitor has been closed
|
// check if this monitor has been closed
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-monitor.ctx.Done():
|
||||||
cancel()
|
cancel()
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user