mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-15 20:37:29 +01:00
16 lines
1.0 KiB
Plaintext
16 lines
1.0 KiB
Plaintext
All 31 `.Query()` calls now have proper `rows.Close()`. Build passes, tests pass, vet clean.
|
|
|
|
### Summary of changes
|
|
|
|
**`internal/repository/stats.go`** (7 fixes + 1 rewrite):
|
|
- Added `defer rows.Close()` + `rows.Err()` to `JobsStatsGrouped`, `JobCountGrouped`, `AddJobCountGrouped`, `jobsStatisticsHistogram`, `jobsDurationStatisticsHistogram`, `jobsMetricStatisticsHistogram`
|
|
- Rewrote `AddJobCount` to use `QueryRow()` instead of `Query()` (single-row result)
|
|
|
|
**`internal/repository/tags.go`** (5 fixes):
|
|
- Added `defer xrows.Close()` + `xrows.Err()` for `Queryx` in `CountTags`
|
|
- Added `defer rows.Close()` for second query in `CountTags`
|
|
- Added `defer rows.Close()` + `rows.Err()` to `GetTags`, `GetTagsDirect`, `getArchiveTags`
|
|
|
|
**`internal/repository/node.go`** (4 fixes + 1 rewrite):
|
|
- Added `defer rows.Close()` + `rows.Err()`, removed manual `rows.Close()` in `QueryNodes`, `QueryNodesWithMeta`, `CountStatesTimed`
|
|
- Rewrote `CountStates` to use `COUNT(*) ... GROUP BY` in SQL instead of fetching every row and counting in Go |