mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 12:42:34 +02:00
small changes
This commit is contained in:
parent
10591452e4
commit
4188bbc5bd
2 changed files with 4 additions and 3 deletions
|
@ -155,11 +155,11 @@ func (p *Provider) ScheduleRenewal() {
|
||||||
go func() {
|
go func() {
|
||||||
task := task.GlobalTask("cert renew scheduler")
|
task := task.GlobalTask("cert renew scheduler")
|
||||||
defer task.Finish("cert renew scheduler stopped")
|
defer task.Finish("cert renew scheduler stopped")
|
||||||
|
|
||||||
for {
|
for {
|
||||||
renewalTime := p.ShouldRenewOn()
|
renewalTime := p.ShouldRenewOn()
|
||||||
timer := time.NewTimer(time.Until(renewalTime))
|
timer := time.NewTimer(time.Until(renewalTime))
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-task.Context().Done():
|
case <-task.Context().Done():
|
||||||
timer.Stop()
|
timer.Stop()
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -40,5 +41,5 @@ func (cidr *CIDR) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cidr *CIDR) Equals(other *CIDR) bool {
|
func (cidr *CIDR) Equals(other *CIDR) bool {
|
||||||
return (*net.IPNet)(cidr).IP.Equal(other.IP) && cidr.Mask.String() == other.Mask.String()
|
return (*net.IPNet)(cidr).IP.Equal(other.IP) && bytes.Equal(cidr.Mask, other.Mask)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue