Skip to content

Commit

Permalink
fix(db): fix namings in DBDeleteOldOverviews function
Browse files Browse the repository at this point in the history
Ref: SRX-0Q0FWU
  • Loading branch information
AminSlk committed Oct 8, 2024
1 parent dbfa856 commit b007300
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/kuberpult/templates/cd-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ spec:
value: {{ .Values.git.webUrl | quote }}
{{- if .Values.datadogTracing.enabled }}
- name: KUBERPULT_CACHE_TTL_HOURS
value: {{ default 24 .Values.cd.cacheTtlHours }}
value: {{ .Values.cd.cacheTtlHours }}
- name: DD_AGENT_HOST
valueFrom:
fieldRef:
Expand Down
6 changes: 4 additions & 2 deletions pkg/db/overview.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (h *DBHandler) IsOverviewEmpty(overviewResp *api.GetOverviewResponse) bool
return false
}

func (h *DBHandler) DBDeleteOldOverviews(ctx context.Context, tx *sql.Tx, numberOfToKeepOverviews uint64, timeThreshold time.Time) error {
func (h *DBHandler) DBDeleteOldOverviews(ctx context.Context, tx *sql.Tx, numberOfOverviewsToKeep uint64, timeThreshold time.Time) error {
span, _ := tracer.StartSpanFromContext(ctx, "DBDeleteOldOverviews")
defer span.Finish()

Expand All @@ -339,10 +339,12 @@ AND eslversion NOT IN (
);
`)
span.SetTag("query", deleteQuery)
span.SetTag("numberOfOverviewsToKeep", numberOfOverviewsToKeep)
span.SetTag("timeThreshold", timeThreshold)
_, err := tx.Exec(
deleteQuery,
timeThreshold.UTC(),
numberOfToKeepOverviews,
numberOfOverviewsToKeep,
)
if err != nil {
return fmt.Errorf("DBDeleteOldOverviews error executing query: %w", err)
Expand Down

0 comments on commit b007300

Please sign in to comment.