feat: aggregate dashboard metrics server-side
This commit is contained in:
parent
c3ee23f967
commit
3b0484a9ad
4 changed files with 641 additions and 198 deletions
|
|
@ -3,12 +3,17 @@ import { api } from "./_generated/api"
|
|||
|
||||
const crons = cronJobs()
|
||||
|
||||
crons.interval(
|
||||
"report-export-runner",
|
||||
{ minutes: 15 },
|
||||
api.reports.triggerScheduledExports,
|
||||
{}
|
||||
)
|
||||
// Keep the handler available but only register it when explicitly enabled in Convex env.
|
||||
const reportsCronEnabled = process.env.REPORTS_CRON_ENABLED === "true"
|
||||
|
||||
if (reportsCronEnabled) {
|
||||
crons.interval(
|
||||
"report-export-runner",
|
||||
{ minutes: 15 },
|
||||
api.reports.triggerScheduledExports,
|
||||
{}
|
||||
)
|
||||
}
|
||||
|
||||
crons.daily(
|
||||
"auto-pause-internal-lunch",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue