fix(filters): postgres dl limits check (#308)

This commit is contained in:
Ludvig Lundgren 2022-06-15 19:39:21 +02:00 committed by GitHub
parent 6675a1df3e
commit f67c92340a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -693,7 +693,7 @@ func (r *FilterRepo) downloadsByFilterPostgres(ctx context.Context, tx *Tx, filt
COALESCE(SUM(CASE WHEN "release".timestamp >= date_trunc('month', CURRENT_DATE) THEN 1 ELSE 0 END),0) as "month_count", COALESCE(SUM(CASE WHEN "release".timestamp >= date_trunc('month', CURRENT_DATE) THEN 1 ELSE 0 END),0) as "month_count",
count(*) as "total_count" count(*) as "total_count"
FROM "release" FROM "release"
WHERE "release".filter_id = ?;` WHERE "release".filter_id = $1;`
row := tx.QueryRowContext(ctx, query, filterID) row := tx.QueryRowContext(ctx, query, filterID)
if err := row.Err(); err != nil { if err := row.Err(); err != nil {