introduce databse connection pooling and harden RowSet operations

This commit is contained in:
amy
2026-11-12 14:25:11 -07:00
parent ec50f048a1
commit 630d129bb5
10 changed files with 97 additions and 21 deletions
+2 -1
View File
@@ -243,6 +243,7 @@ func AmSearchCategories(ctx context.Context, oper int, term string, offset int,
if err != nil {
return nil, total, err
}
defer rs.Close()
rc := make([]*Category, 0, min(max, 1000))
for rs.Next() {
var catid int32
@@ -256,5 +257,5 @@ func AmSearchCategories(ctx context.Context, oper int, term string, offset int,
log.Errorf("AmSearchCategoris scan error: %v", err)
}
}
return rc, total, nil
return rc, total, rs.Err()
}