Skip to content

Commit 39bb02e

Browse files
authored
(BIDS-2896) frontend: fix wrongly daily number of api-calls in user-settings (#2797)
1 parent 7c6a8f0 commit 39bb02e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

db/frontend.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -696,14 +696,14 @@ func GetUserAPIKeyStatistics(apikey *string) (*types.ApiStatistics, error) {
696696
FROM
697697
api_statistics
698698
WHERE
699-
ts > NOW() - INTERVAL '1 day' AND apikey = $1
699+
ts >= DATE_TRUNC('day', NOW()) AND apikey = $1
700700
), (
701701
SELECT
702702
COALESCE(SUM(count),0) as monthly
703703
FROM
704704
api_statistics
705705
WHERE
706-
ts > DATE_TRUNC('month', NOW()) AND apikey = $1
706+
ts >= DATE_TRUNC('month', NOW()) AND apikey = $1
707707
)`
708708

709709
err := FrontendWriterDB.Get(stats, query, apikey)

0 commit comments

Comments
 (0)