Merge pull request #70 from sgotti/executor_fix_task_endtime_setup_step_failed

executor: fix typo in setting task endTime when setup failed
This commit is contained in:
Simone Gotti 2019-07-29 14:43:02 +02:00 committed by GitHub
commit 43e445f3aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -788,8 +788,8 @@ func (e *Executor) executeTask(ctx context.Context, et *types.ExecutorTask) {
if err := e.setupTask(ctx, rt); err != nil {
log.Errorf("err: %+v", err)
rt.et.Status.Phase = types.ExecutorTaskPhaseFailed
et.Status.SetupStep.EndTime = util.TimePtr(time.Now())
et.Status.Phase = types.ExecutorTaskPhaseFailed
et.Status.EndTime = util.TimePtr(time.Now())
et.Status.SetupStep.Phase = types.ExecutorTaskPhaseFailed
et.Status.SetupStep.EndTime = util.TimePtr(time.Now())
if err := e.sendExecutorTaskStatus(ctx, et); err != nil {
@ -812,12 +812,12 @@ func (e *Executor) executeTask(ctx context.Context, et *types.ExecutorTask) {
rt.Lock()
if err != nil {
log.Errorf("err: %+v", err)
rt.et.Status.Phase = types.ExecutorTaskPhaseFailed
et.Status.Phase = types.ExecutorTaskPhaseFailed
} else {
rt.et.Status.Phase = types.ExecutorTaskPhaseSuccess
et.Status.Phase = types.ExecutorTaskPhaseSuccess
}
rt.et.Status.EndTime = util.TimePtr(time.Now())
et.Status.EndTime = util.TimePtr(time.Now())
if err := e.sendExecutorTaskStatus(ctx, et); err != nil {
log.Errorf("err: %+v", err)