Skip to content

Commit 92ad52f

Browse files
committed
fix(api/history): use _rvc index pattern in expireStaleExecutionsSweep
Avoids gocritic rangeValCopy warning (304-byte PurchaseExecution copied on each iteration); consistent with the rest of handler_history.go.
1 parent 505d9b4 commit 92ad52f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎internal/api/handler_history.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ func (h *Handler) expireStaleExecutions(staleExecs []config.PurchaseExecution) {
235235
// should not abort the best-effort transitions.
236236
func (h *Handler) expireStaleExecutionsSweep(staleExecs []config.PurchaseExecution) {
237237
ctx := context.Background()
238-
for _, exec := range staleExecs {
238+
for _rvc := range staleExecs {
239+
exec := staleExecs[_rvc]
239240
_, err := h.config.TransitionExecutionStatus(ctx, exec.ExecutionID, []string{"pending", "notified"}, "expired", nil)
240241
if err != nil {
241242
logging.Warnf("history: expire sweep for execution %s failed: %v", exec.ExecutionID, err)

0 commit comments

Comments
 (0)