warmup.mjs
22 lines 849 B
Raw
sha256:c2dbf04d56308f3bbf2d06e6d2eb022b8948b1e827195fe525a44e5e18d5f9c0 feat(auth): Phase B Connect cloud agent (RFC 8628) + Hermes… Human minor ⚠ breaking 12 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 1 commit
sha256:93bcf8f9bd56d8c5b9339f4ec73b9ebd66571398d56262d38eedc2cfa9db9882 fix(test): align Band B landing assertion with desktop MCP … Human 12 days ago