Skip to content

Commit b605124

Browse files
committed
fix rewards total query
1 parent be3d9a6 commit b605124

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

worker/earn.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export async function earn ({ name }) {
2525
SELECT sum("msats") as "msats"
2626
FROM "AggRewards"
2727
WHERE date_trunc('day', "timeBucket") = date_trunc('day', now() AT TIME ZONE 'America/Chicago' - interval '1 day')
28-
AND "payInType" IS NULL`
28+
AND "payInType" IS NULL
29+
AND granularity = 'DAY'`
2930

3031
if (!totalMsatsDecimal || totalMsatsDecimal.lessThanOrEqualTo(0)) {
3132
throw new Error('no rewards to distribute')

0 commit comments

Comments
 (0)