mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-19 19:23:39 +09:00
fix(actions): use gitea's clock for actions durations (#39323)
This commit is contained in:
@@ -55,9 +55,8 @@ func generateMockStepsLog(logCur actions.LogCursor, opts generateMockStepsLogOpt
|
||||
logStr = strings.ReplaceAll(logStr, "{step}", strconv.Itoa(logCur.Step))
|
||||
logStr = strings.ReplaceAll(logStr, "{cursor}", strconv.FormatInt(cur, 10))
|
||||
stepsLog = append(stepsLog, &actions.ViewStepLog{
|
||||
Step: logCur.Step,
|
||||
Cursor: cur,
|
||||
Started: time.Now().Unix() - 1,
|
||||
Step: logCur.Step,
|
||||
Cursor: cur,
|
||||
Lines: []*actions.ViewStepLogLine{
|
||||
{Index: cur, Message: logStr, Timestamp: float64(time.Now().UnixNano()) / float64(time.Second)},
|
||||
},
|
||||
|
||||
@@ -406,10 +406,9 @@ type ViewJobStep struct {
|
||||
}
|
||||
|
||||
type ViewStepLog struct {
|
||||
Step int `json:"step"`
|
||||
Cursor int64 `json:"cursor"`
|
||||
Lines []*ViewStepLogLine `json:"lines"`
|
||||
Started int64 `json:"started"`
|
||||
Step int `json:"step"`
|
||||
Cursor int64 `json:"cursor"`
|
||||
Lines []*ViewStepLogLine `json:"lines"`
|
||||
}
|
||||
|
||||
type ViewStepLogLine struct {
|
||||
@@ -875,7 +874,6 @@ func convertToViewModel(ctx context.Context, locale translation.Locale, cursors
|
||||
Timestamp: float64(task.Updated.AsTime().UnixNano()) / float64(time.Second),
|
||||
},
|
||||
},
|
||||
Started: int64(step.Started),
|
||||
})
|
||||
}
|
||||
continue
|
||||
@@ -911,10 +909,9 @@ func convertToViewModel(ctx context.Context, locale translation.Locale, cursors
|
||||
}
|
||||
|
||||
logs = append(logs, &ViewStepLog{
|
||||
Step: cursor.Step,
|
||||
Cursor: cursor.Cursor + int64(len(logLines)),
|
||||
Lines: logLines,
|
||||
Started: int64(step.Started),
|
||||
Step: cursor.Step,
|
||||
Cursor: cursor.Cursor + int64(len(logLines)),
|
||||
Lines: logLines,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user