From d2c4c4f71b8575fc11af4191ea205d9f4a0a808c Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Wed, 11 May 2022 16:44:55 +0800 Subject: [PATCH] fix: gc history update_time Signed-off-by: Shengwen Yu --- src/controller/gc/controller.go | 2 +- src/controller/gc/model.go | 6 +++--- src/server/v2.0/handler/gc.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/controller/gc/controller.go b/src/controller/gc/controller.go index 19ef9e10d0..844df7904c 100644 --- a/src/controller/gc/controller.go +++ b/src/controller/gc/controller.go @@ -218,7 +218,7 @@ func convertExecution(exec *task.Execution) *Execution { Trigger: exec.Trigger, ExtraAttrs: exec.ExtraAttrs, StartTime: exec.StartTime, - EndTime: exec.EndTime, + UpdateTime: exec.UpdateTime, } } diff --git a/src/controller/gc/model.go b/src/controller/gc/model.go index a236ef06c3..5e6daf142d 100644 --- a/src/controller/gc/model.go +++ b/src/controller/gc/model.go @@ -26,7 +26,7 @@ type TriggerSettings struct { Cron string `json:"cron"` } -// Execution model for replication +// Execution model for gc type Execution struct { ID int64 Status string @@ -34,10 +34,10 @@ type Execution struct { Trigger string ExtraAttrs map[string]interface{} StartTime time.Time - EndTime time.Time + UpdateTime time.Time } -// Task model for replication +// Task model for gc type Task struct { ID int64 ExecutionID int64 diff --git a/src/server/v2.0/handler/gc.go b/src/server/v2.0/handler/gc.go index dad835f504..e4106a72ac 100644 --- a/src/server/v2.0/handler/gc.go +++ b/src/server/v2.0/handler/gc.go @@ -168,7 +168,7 @@ func (g *gcAPI) GetGCHistory(ctx context.Context, params operation.GetGCHistoryP }, Status: exec.Status, CreationTime: exec.StartTime, - UpdateTime: exec.EndTime, + UpdateTime: exec.UpdateTime, }) } @@ -207,7 +207,7 @@ func (g *gcAPI) GetGC(ctx context.Context, params operation.GetGCParams) middlew Type: exec.Trigger, }, CreationTime: exec.StartTime, - UpdateTime: exec.EndTime, + UpdateTime: exec.UpdateTime, } return operation.NewGetGCOK().WithPayload(res.ToSwagger())