fix postgres code path
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-02-11 09:54:55 +11:00
parent a09d94a266
commit ee3b2d7f21
2 changed files with 8 additions and 9 deletions

View File

@@ -12,7 +12,6 @@ import (
"sync"
"time"
"vctp/db"
"vctp/db/queries"
"vctp/internal/metrics"
"vctp/internal/report"
)
@@ -559,7 +558,6 @@ WHERE "Vcenter" = ? AND "DeletedAt" IS NOT NULL AND "DeletedAt" > 0 AND "Deleted
}
func (c *CronTask) applyInventoryDeletions(ctx context.Context, agg map[dailyAggKey]*dailyAggVal, start, end time.Time) int {
dbConn := c.Database.DB()
vcenters := make(map[string]struct{}, 8)
for k := range agg {
if k.Vcenter != "" {
@@ -568,7 +566,7 @@ func (c *CronTask) applyInventoryDeletions(ctx context.Context, agg map[dailyAgg
}
totalApplied := 0
for vcenter := range vcenters {
inventoryRows, err := queries.New(dbConn).GetInventoryByVcenter(ctx, vcenter)
inventoryRows, err := c.Database.Queries().GetInventoryByVcenter(ctx, vcenter)
if err != nil {
c.Logger.Warn("failed to load inventory for daily deletion times", "vcenter", vcenter, "error", err)
continue