improve concurrency handling for inventory job
Some checks failed
continuous-integration/drone/push Build encountered an error

This commit is contained in:
2026-01-21 11:21:51 +11:00
parent 715b293894
commit b77f8671da
4 changed files with 29 additions and 13 deletions

View File

@@ -149,7 +149,7 @@ func TableHasRows(ctx context.Context, dbConn *sqlx.DB, table string) (bool, err
ctx = context.Background()
}
var cancel context.CancelFunc
ctx, cancel = context.WithTimeout(ctx, 15*time.Second)
ctx, cancel = context.WithTimeout(ctx, 5*time.Second)
defer cancel()
query := fmt.Sprintf(`SELECT 1 FROM %s LIMIT 1`, table)
var exists int