feat(cert): invoke SweepStalePending at cron startup

This commit is contained in:
Hintay
2026-05-23 04:46:26 +09:00
parent cd48107c9b
commit 77bf8f8a07
+7
View File
@@ -3,6 +3,7 @@ package cron
import (
"context"
"github.com/0xJacky/Nginx-UI/internal/cert"
"github.com/go-co-op/gocron/v2"
"github.com/uozi-tech/cosy/logger"
)
@@ -20,6 +21,12 @@ func init() {
// InitCronJobs initializes and starts all cron jobs
func InitCronJobs(ctx context.Context) {
// Sweep any cert rows still marked "pending" — they belong to an
// issuance that was killed by the previous shutdown.
if err := cert.SweepStalePending(); err != nil {
logger.Errorf("SweepStalePending Err: %v\n", err)
}
// Initialize auto cert job
_, err := setupAutoCertJob(s)
if err != nil {