mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-11 09:46:37 +08:00
[新增] 添加 ACME 和 DNS 账号管理功能,支持证书申请与续期
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package job
|
||||
|
||||
import (
|
||||
"github.com/robfig/cron/v3"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
var cronRunner *cron.Cron
|
||||
|
||||
func InitCronJobs() {
|
||||
cronRunner = cron.New()
|
||||
|
||||
// Register SSL renew job
|
||||
_, err := cronRunner.AddJob("0 0 * * *", &SSLRenewJob{})
|
||||
if err != nil {
|
||||
slog.Error("failed to register SSL renew cron job", "error", err)
|
||||
} else {
|
||||
slog.Info("registered SSL renew cron job")
|
||||
}
|
||||
|
||||
cronRunner.Start()
|
||||
}
|
||||
|
||||
func StopCronJobs() {
|
||||
if cronRunner != nil {
|
||||
cronRunner.Stop()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user