Fix monitoring PF CI lint issues
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 37s
CI / go (push) Successful in 43s
CI / python (push) Successful in 2s

This commit is contained in:
Grendgi
2026-06-09 11:33:33 +03:00
parent 95112cc450
commit d53ecb2add
6 changed files with 36 additions and 28 deletions

View File

@@ -57,7 +57,7 @@ func (a *App) ListEmployees(ctx context.Context, isAdmin bool, current *Employee
if err != nil {
return nil, err
}
defer rows.Close()
defer closeRows(rows)
return scanEmployees(rows)
}
@@ -268,7 +268,7 @@ func (a *App) ListProjects(ctx context.Context, ownerID int64) ([]Project, error
if err != nil {
return nil, err
}
defer rows.Close()
defer closeRows(rows)
items := []Project{}
for rows.Next() {
p, err := a.scanProject(ctx, rows, false)
@@ -353,7 +353,7 @@ func (a *App) DeleteProject(ctx context.Context, ownerID, projectID int64) error
if err != nil {
return err
}
defer tx.Rollback()
defer rollbackTx(tx)
listingRows, err := tx.QueryContext(ctx, `SELECT id FROM competitor_listings WHERE project_id = ?`, projectID)
if err != nil {
return err
@@ -362,12 +362,12 @@ func (a *App) DeleteProject(ctx context.Context, ownerID, projectID int64) error
for listingRows.Next() {
var id int64
if err := listingRows.Scan(&id); err != nil {
listingRows.Close()
closeRows(listingRows)
return err
}
listingIDs = append(listingIDs, id)
}
listingRows.Close()
closeRows(listingRows)
for _, id := range listingIDs {
if _, err := tx.ExecContext(ctx, `DELETE FROM price_history WHERE listing_id = ?`, id); err != nil {
return err
@@ -392,7 +392,7 @@ func (a *App) DeleteListing(ctx context.Context, ownerID, listingID int64) error
if err != nil {
return err
}
defer tx.Rollback()
defer rollbackTx(tx)
if _, err := tx.ExecContext(ctx, `
DELETE FROM price_history
WHERE listing_id IN (
@@ -508,10 +508,10 @@ func (a *App) ListingsForProject(ctx context.Context, projectID int64, withHisto
items = append(items, *item)
}
if err := rows.Err(); err != nil {
rows.Close()
closeRows(rows)
return nil, err
}
rows.Close()
closeRows(rows)
if withHistory {
for i := range items {
history, err := a.PriceHistory(ctx, items[i].ID)
@@ -562,7 +562,7 @@ func (a *App) TeamOverview(ctx context.Context, portalUserIDs []string, all bool
if err != nil {
return nil, err
}
defer rows.Close()
defer closeRows(rows)
items := []TeamOverviewRow{}
for rows.Next() {
var item TeamOverviewRow
@@ -614,7 +614,7 @@ func (a *App) PriceHistory(ctx context.Context, listingID int64) ([]PricePoint,
if err != nil {
return nil, err
}
defer rows.Close()
defer closeRows(rows)
out := []PricePoint{}
for rows.Next() {
var p PricePoint