保存执行租约与原子绑定复核前检查点

This commit is contained in:
xuans committed 2026-10-04 07:31:40 +08:00
1 parent 73dba287d9
commit 7a3b78daa3
28 files changed
+1236 -48

No files matched your search

+1
View File
@@ -144,6 +144,7 @@ func NewWithConfigPath(ctx context.Context, cfg config.Config, configPath string
}
accounts := certificate.NewAccountRepository(secretStore)
certificates := certificate.NewService(cfg, repo, secretStore, dnsprovider.NewLegoFactory(), accounts)
certificates.SetDNSExecutionLeaseStore(repository.NewSQLProjectMemberRepository(db.DB, runtimeDatabaseConfig.Driver))
httpChallenges := httpchallenge.NewStore()
certificates.SetHTTPChallenges(httpChallenges)
aliyunAuthChecker := dnsprovider.NewAliyunAuthorizationChecker()
@@ -157,6 +157,10 @@ func (w *certificateTaskWorkflow) run(ctx context.Context, id, taskType, stage s
issueCtx = deployment.WithTransactionContext(issueCtx, deployment.TransactionContext{
TaskID: task.ID, AttemptID: attempt.ID, AttemptNumber: attempt.AttemptNumber,
})
issueCtx = certificate.WithDNSExecutionIdentity(issueCtx, domain.DNSExecutionIdentity{
TaskID: task.ID, AttemptID: attempt.ID, AttemptNumber: attempt.AttemptNumber,
Scheduled: taskType == "renewal_run" && task.OperatorID == "",
})
result, resultErr = execute(issueCtx, id)
cancel()
if resultErr == nil || number == attempts || result.Certificate.Saved.CertificatePath != "" || result.Deployment.Status == "partial" || result.Deployment.RecoveryStatus == "unconfirmed" || result.Deployment.RecoveryStatus == "failed" || errors.Is(resultErr, context.Canceled) || errors.Is(resultErr, context.DeadlineExceeded) {