fix63 use sleep instead of force scheduling

This commit is contained in:
Jian Wang 2022-07-25 14:33:03 +02:00
parent 8ebd77f8a4
commit bad953b9f0

View File

@ -7,7 +7,6 @@ import (
"crypto/x509"
"net"
"net/http"
"runtime"
"strings"
"sync"
"time"
@ -163,9 +162,9 @@ type listener struct {
func (l *listener) WrapExpiration(days int) net.Listener {
ctx, cancel := context.WithCancel(context.Background())
go func() {
// busy-wait for certificate preload to complete
// loop on short sleeps until certificate preload completes
for l.cert == nil {
runtime.Gosched()
time.Sleep(time.Millisecond)
}
for {