mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-19 20:32:35 +02:00
Merge branch 'main' into refactor/organize-code
This commit is contained in:
parent
6e9ce8e14a
commit
8487a53001
2 changed files with 9 additions and 2 deletions
|
@ -43,6 +43,12 @@ type (
|
|||
|
||||
var ErrGetCertFailure = errors.New("get certificate failed")
|
||||
|
||||
func TestProvider(cert *tls.Certificate) *Provider {
|
||||
return &Provider{
|
||||
tlsCert: cert,
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Provider) GetCert(_ *tls.ClientHelloInfo) (*tls.Certificate, error) {
|
||||
if p.tlsCert == nil {
|
||||
return nil, ErrGetCertFailure
|
||||
|
@ -173,7 +179,7 @@ func (p *Provider) ScheduleRenewal(parent task.Parent) {
|
|||
timer := time.NewTimer(time.Until(renewalTime))
|
||||
defer timer.Stop()
|
||||
|
||||
task := parent.Subtask("cert-renew-scheduler")
|
||||
task := parent.Subtask("cert-renew-scheduler", true)
|
||||
defer task.Finish(nil)
|
||||
|
||||
for {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package strutils
|
||||
package strutils_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/yusing/go-proxy/internal/utils/strutils"
|
||||
expect "github.com/yusing/go-proxy/internal/utils/testing"
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue