From c14634d8e7d66ea51ab77cbf33901c3fa91db0c9 Mon Sep 17 00:00:00 2001 From: cubemaze Date: Fri, 28 Jul 2023 07:06:45 +0800 Subject: [PATCH] fix: renewCertTask --- node/cert.go | 6 +++--- node/task.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/node/cert.go b/node/cert.go index 1df319c..d7f7620 100644 --- a/node/cert.go +++ b/node/cert.go @@ -7,17 +7,17 @@ import ( "log" ) -func (c *Controller) renewCertTask() { +func (c *Controller) renewCertTask() error { l, err := lego.New(c.CertConfig) if err != nil { log.Print("new lego error: ", err) - return + return nil } err = l.RenewCert() if err != nil { log.Print("renew cert error: ", err) - return } + return nil } func (c *Controller) requestCert() error { diff --git a/node/task.go b/node/task.go index d9ce94c..817d1af 100644 --- a/node/task.go +++ b/node/task.go @@ -32,7 +32,7 @@ func (c *Controller) startTasks(node *panel.NodeInfo) { default: c.renewCertPeriodic = &task.Task{ Interval: time.Hour * 24, - Execute: c.reportUserTrafficTask, + Execute: c.renewCertTask, } log.WithField("tag", c.tag).Info("Start renew cert") // delay to start renewCert