This commit is contained in:
@@ -117,6 +117,7 @@ type snapshotTable struct {
|
||||
}
|
||||
|
||||
func listHourlyTablesForDay(ctx context.Context, dbConn *sqlx.DB, dayStart, dayEnd time.Time) ([]snapshotTable, error) {
|
||||
log := loggerFromCtx(ctx, nil)
|
||||
rows, err := dbConn.QueryxContext(ctx, `
|
||||
SELECT table_name, snapshot_time, snapshot_count
|
||||
FROM snapshot_registry
|
||||
@@ -139,6 +140,9 @@ ORDER BY snapshot_time ASC
|
||||
}
|
||||
// Trust snapshot_count if present; otherwise optimistically include to avoid long probes.
|
||||
if t.Count.Valid && t.Count.Int64 <= 0 {
|
||||
if log != nil {
|
||||
log.Debug("skipping snapshot table with zero count", "table", t.Table, "snapshot_time", t.Time)
|
||||
}
|
||||
continue
|
||||
}
|
||||
tables = append(tables, t)
|
||||
|
||||
Reference in New Issue
Block a user