Skip to content

Commit 53a1e49

Browse files
committed
wip: zen
1 parent a32bedb commit 53a1e49

File tree

1 file changed

+6
-1
lines changed
  • packages/console/app/src/routes/zen/util

1 file changed

+6
-1
lines changed

packages/console/app/src/routes/zen/util/handler.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,12 @@ export async function handler(
676676
ELSE ${cost}
677677
END
678678
`,
679-
timeRollingUpdated: sql`now()`,
679+
timeRollingUpdated: sql`
680+
CASE
681+
WHEN UNIX_TIMESTAMP(${SubscriptionTable.timeRollingUpdated}) >= UNIX_TIMESTAMP(now()) - ${rollingWindowSeconds} THEN ${SubscriptionTable.timeRollingUpdated}
682+
ELSE now()
683+
END
684+
`,
680685
})
681686
.where(
682687
and(

0 commit comments

Comments
 (0)