forked from TanStack/tanstack.com
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnetlify.toml
More file actions
43 lines (38 loc) · 1.55 KB
/
netlify.toml
File metadata and controls
43 lines (38 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
[build]
command = "vite build"
publish = "dist/client"
[functions]
directory = "netlify/functions"
# Scheduled + Background Function Pattern
#
# The pattern for long-running cron jobs:
# 1. Scheduled function (30s timeout) runs on cron schedule
# 2. It invokes the background function via HTTP
# 3. Returns immediately (202)
# 4. Background function (15 min timeout) does the actual work
#
# Background functions are identified by the `-background` suffix in the filename.
# They can also be invoked manually from the admin panel.
# Scheduled function: Stats cache refresh (runs every 6 hours)
[functions."scheduled/refresh-stats-cache"]
schedule = "0 */6 * * *"
# Scheduled function: GitHub release sync (runs every 6 hours)
[functions."scheduled/sync-github-releases"]
schedule = "0 */6 * * *"
# Background Functions (invoked by scheduled functions or manually)
#
# 1. refresh-stats-cache-background.ts
# - Refreshes NPM and GitHub stats cache for the entire TanStack org
# - ~10-20 minutes to complete (200+ packages)
# - Invoked by: scheduled/refresh-stats-cache
# - Manual: POST /.netlify/functions/refresh-stats-cache-background
# - Authorization: Bearer YOUR_CRON_SECRET
#
# 2. sync-github-releases-background.ts
# - Syncs GitHub releases from all TanStack repos to the feed
# - ~1-5 minutes to complete
# - Invoked by: scheduled/sync-github-releases
# - Manual: POST /.netlify/functions/sync-github-releases-background
# - Authorization: Bearer YOUR_CRON_SECRET
#
# Note: Both functions require CRON_SECRET environment variable for authentication