fix: renewCertTask

This commit is contained in:
cubemaze 2023-07-28 07:06:45 +08:00
parent 89e15fc438
commit c14634d8e7
2 changed files with 4 additions and 4 deletions

View File

@ -7,17 +7,17 @@ import (
"log" "log"
) )
func (c *Controller) renewCertTask() { func (c *Controller) renewCertTask() error {
l, err := lego.New(c.CertConfig) l, err := lego.New(c.CertConfig)
if err != nil { if err != nil {
log.Print("new lego error: ", err) log.Print("new lego error: ", err)
return return nil
} }
err = l.RenewCert() err = l.RenewCert()
if err != nil { if err != nil {
log.Print("renew cert error: ", err) log.Print("renew cert error: ", err)
return
} }
return nil
} }
func (c *Controller) requestCert() error { func (c *Controller) requestCert() error {

View File

@ -32,7 +32,7 @@ func (c *Controller) startTasks(node *panel.NodeInfo) {
default: default:
c.renewCertPeriodic = &task.Task{ c.renewCertPeriodic = &task.Task{
Interval: time.Hour * 24, Interval: time.Hour * 24,
Execute: c.reportUserTrafficTask, Execute: c.renewCertTask,
} }
log.WithField("tag", c.tag).Info("Start renew cert") log.WithField("tag", c.tag).Info("Start renew cert")
// delay to start renewCert // delay to start renewCert