Merge pull request #64 from w13915984028/fix63

fix63 use sleep instead of force scheduling
This commit is contained in:
Caleb Bron 2022-07-28 13:43:07 -07:00 committed by GitHub
commit 401fafb7e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 {