Skip to content

Commit

Permalink
rename output_size to output_size_limit as per review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
fopina committed Jan 27, 2022
1 parent 98e37fc commit 62a96b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions dkron/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ func (h *HTTPTransport) executionsHandler(c *gin.Context) {
sort = "started_at"
}
order := c.DefaultQuery("_order", "DESC")
output_size, err := strconv.Atoi(c.DefaultQuery("output_size", ""))
output_size_limit, err := strconv.Atoi(c.DefaultQuery("output_size_limit", ""))
if err != nil {
output_size = -1
output_size_limit = -1
}

job, err := h.agent.Store.GetJob(jobName, nil)
Expand All @@ -362,12 +362,12 @@ func (h *HTTPTransport) executionsHandler(c *gin.Context) {
return
}

if output_size > 0 {
if output_size_limit > 0 {
// truncate execution output
for _, execution := range executions {
_s := len(execution.Output)
if _s > output_size {
execution.Output = execution.Output[_s-output_size:]
if _s > output_size_limit {
execution.Output = execution.Output[_s-output_size_limit:]
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/dataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const myDataProvider = {
_order: order,
_start: (page - 1) * perPage,
_end: page * perPage,
output_size: 200,
output_size_limit: 200,
};
const url = `${apiUrl}/${params.target}/${params.id}/${resource}?${stringify(query)}`;

Expand Down

0 comments on commit 62a96b5

Please sign in to comment.