mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-06-19 07:36:59 +00:00
feat(cert): invoke SweepStalePending at cron startup
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user