Rocky_Mountain_Vending/.pnpm-store/v10/files/e8/3c85f77255db0b535c997fd37d792703c8559f2ea20a69e0073626a625b117cbc51da4231c794725e5ecb70b376fbfabeae330bf88848e0d7b0ebf009698cf
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

22 lines
710 B
Text

import { timing } from "./timing";
const DEFER_EVENT_LISTENER_TIME = 3000;
export const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME) => {
if (keepAlive !== true) {
return -1;
}
const registerListener = () => {
if (request.socket) {
request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
}
else {
request.on("socket", (socket) => {
socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
});
}
};
if (deferTimeMs === 0) {
registerListener();
return 0;
}
return timing.setTimeout(registerListener, deferTimeMs);
};