fix: Prevent memory explosion in sqlite. And make db options configurable

Entire-Checkpoint: e368e6d8abf3
This commit is contained in:
2026-03-11 06:14:05 +01:00
parent 301e590580
commit 09fa239e8b
9 changed files with 135 additions and 18 deletions

View File

@@ -84,7 +84,7 @@ func (r *JobRepository) QueryJobs(
query = BuildWhereClause(f, query)
}
rows, err := query.RunWith(r.stmtCache).Query()
rows, err := query.RunWith(r.stmtCache).QueryContext(ctx)
if err != nil {
queryString, queryVars, _ := query.ToSql()
return nil, fmt.Errorf("query failed [%s] %v: %w", queryString, queryVars, err)
@@ -126,7 +126,7 @@ func (r *JobRepository) CountJobs(
}
var count int
if err := query.RunWith(r.DB).Scan(&count); err != nil {
if err := query.RunWith(r.DB).QueryRowContext(ctx).Scan(&count); err != nil {
return 0, fmt.Errorf("failed to count jobs: %w", err)
}