-
Notifications
You must be signed in to change notification settings - Fork 404
Open
Labels
Description
Is your feature request related to a problem? Please describe.
The current implementation is to obtain all Execution records first, and then filter according to the Execution name.
Why not get it directly through fmt.Sprintf("%s:%s:%s", executionsPrefix, execution.JobName, execution.Key())?
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Lines 387 to 416 in 53864a0
| func (h *HTTPTransport) executionHandler(c *gin.Context) { | |
| jobName := c.Param("job") | |
| executionName := c.Param("execution") | |
| job, err := h.agent.Store.GetJob(jobName, nil) | |
| if err != nil { | |
| c.AbortWithError(http.StatusNotFound, err) | |
| return | |
| } | |
| executions, err := h.agent.Store.GetExecutions(job.Name, | |
| &ExecutionOptions{ | |
| Sort: "", | |
| Order: "", | |
| Timezone: job.GetTimeLocation(), | |
| }, | |
| ) | |
| if err != nil { | |
| h.logger.Error(err) | |
| return | |
| } | |
| for _, execution := range executions { | |
| if execution.Id == executionName { | |
| renderJSON(c, http.StatusOK, execution) | |
| return | |
| } | |
| } | |
| } |
Copilot