优化代码

This commit is contained in:
GoEdgeLab
2023-08-08 12:09:20 +08:00
parent d17a7cc4eb
commit 9ed5fab2a8
4 changed files with 12 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package acme
import (
"bytes"
"context"
"encoding/json"
acmeutils "github.com/TeaOSLab/EdgeAPI/internal/acme"
teaconst "github.com/TeaOSLab/EdgeAPI/internal/const"
@@ -434,7 +435,7 @@ func (this *ACMETaskDAO) runTaskWithoutLog(tx *dbs.Tx, taskId int64) (isOk bool,
CertData: certData,
KeyData: keyData,
}
err = sslConfig.Init(nil)
err = sslConfig.Init(context.Background())
if err != nil {
errMsg = "证书生成成功,但是分析证书信息时发生错误:" + err.Error()
return

View File

@@ -70,7 +70,7 @@ func TestServerDomainHourlyStatDAO_FindTopDomainStats(t *testing.T) {
func TestServerDomainHourlyStatDAO_Clean(t *testing.T) {
var dao = NewServerDomainHourlyStatDAO()
err := dao.Clean(nil, 10)
err := dao.CleanDays(nil, 10)
if err != nil {
t.Fatal(err)
}