improve concurrency handling for inventory job
Some checks failed
continuous-integration/drone/push Build encountered an error
Some checks failed
continuous-integration/drone/push Build encountered an error
This commit is contained in:
@@ -137,9 +137,15 @@ ORDER BY snapshot_time ASC
|
||||
if err := db.ValidateTableName(t.Table); err != nil {
|
||||
continue
|
||||
}
|
||||
hasRows, err := db.TableHasRows(ctx, dbConn, t.Table)
|
||||
if err != nil || !hasRows {
|
||||
continue
|
||||
if t.Count.Valid {
|
||||
if t.Count.Int64 <= 0 {
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
hasRows, err := db.TableHasRows(ctx, dbConn, t.Table)
|
||||
if err != nil || !hasRows {
|
||||
continue
|
||||
}
|
||||
}
|
||||
tables = append(tables, t)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user