archbilesherman commented on code in PR #532:
URL: https://github.com/apache/airavata-custos/pull/532#discussion_r3907670436
##########
extensions/SSH-Certificate-Signer/internal/store/certificate_query.go:
##########
@@ -133,6 +140,94 @@ func (d *DB) ListCertificatesByEmail(ctx context.Context,
email string, limit, o
}, nil
}
+// ListCertificates returns a deployment-wide page for privileged
administrators.
+func (d *DB) ListCertificates(ctx context.Context, limit, offset int)
(*CertificateListResult, error) {
+ if limit <= 0 {
+ limit = 20
+ }
+ if limit > 100 {
+ limit = 100
+ }
+ if offset < 0 {
+ offset = 0
+ }
+
+ var total int
+ if err := d.QueryRowContext(ctx, `SELECT COUNT(*) FROM
certificate_issuance_logs`).Scan(&total); err != nil {
Review Comment:
No longer counts every row on every page load.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]