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
@@ -961,6 +961,7 @@ func AmSearchUsers(ctx context.Context, field, oper int, term string, offset, ma
if err != nil {
return nil, total, err
}
defer rs.Close()
rc := make([]*User, 0, min(maxCount, 10000))
for rs.Next() {
var uid int32
@@ -975,5 +976,5 @@ func AmSearchUsers(ctx context.Context, field, oper int, term string, offset, ma
log.Errorf("AmSearchUsers scan error: %v", err)
}
}
return rc, total, nil
return rc, total, rs.Err()
}