mirror of
https://github.com/usual2970/certimate.git
synced 2025-07-30 22:16:52 +00:00
refactor: clean code
This commit is contained in:
@@ -103,13 +103,13 @@ func (a *applyNode) Run(ctx context.Context) error {
|
||||
CertUrl: certificate.CertUrl,
|
||||
CertStableUrl: certificate.CertStableUrl,
|
||||
ExpireAt: cert.NotAfter,
|
||||
Workflow: GetWorkflowId(ctx),
|
||||
NodeId: a.node.Id,
|
||||
WorkflowId: GetWorkflowId(ctx),
|
||||
WorkflowNodeId: a.node.Id,
|
||||
}
|
||||
|
||||
if err := a.outputRepo.Save(ctx, output, certificateRecord, func(id string) error {
|
||||
if certificateRecord != nil {
|
||||
certificateRecord.Output = id
|
||||
certificateRecord.WorkflowOutputId = id
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@@ -53,7 +53,7 @@ func (d *deployNode) Run(ctx context.Context) error {
|
||||
// 部署过但是证书更新了,重新部署
|
||||
// 部署过且证书未更新,直接返回
|
||||
|
||||
if d.deployed(output) && cert.Created.Before(output.Updated) {
|
||||
if d.deployed(output) && cert.CreatedAt.Before(output.UpdatedAt) {
|
||||
d.AddOutput(ctx, d.node.Name, "已部署过且证书未更新")
|
||||
return nil
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
type SettingRepository interface {
|
||||
GetByName(ctx context.Context, name string) (*domain.Setting, error)
|
||||
GetByName(ctx context.Context, name string) (*domain.Settings, error)
|
||||
}
|
||||
type notifyNode struct {
|
||||
node *domain.WorkflowNode
|
||||
|
Reference in New Issue
Block a user