warmup.mjs
22 lines 849 B
Raw
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd feat(calendar): enforce agent context tiers in retrieval AP… Human minor ⚠ breaking 2 days ago
1 /**
2 * Scheduled function: pings the gateway Lambda every 5 minutes to prevent cold starts.
3 * Cold-starting the 1.8 MB gateway bundle takes 12+ seconds on Netlify, which exceeds
4 * browser TLS-handshake timeouts and causes ERR_CONNECTION_CLOSED / ERR_TIMED_OUT.
5 * This keeps the Lambda warm so real user requests always hit a hot instance.
6 */
7 export default async () => {
8 const siteUrl = process.env.URL || 'https://knowtation-gateway.netlify.app';
9 try {
10 const res = await fetch(`${siteUrl}/api/v1/auth/providers`, {
11 signal: AbortSignal.timeout(20000),
12 });
13 console.log('[warmup] gateway responded:', res.status);
14 } catch (e) {
15 console.log('[warmup] gateway ping failed (expected on first cold start):', e?.message || String(e));
16 }
17 return new Response('ok');
18 };
19
20 export const config = {
21 schedule: '* * * * *',
22 };
File History 2 commits
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd feat(calendar): enforce agent context tiers in retrieval AP… Human minor 2 days ago
sha256:9103f98c89257ed2b01c237cea895dabb3e85ea337dccb1161c175e4422355b6 docs: accept Calendar Events v0 spec with Phase 0 security … Human 2 days ago