fix: skip webhook self-test for internal production URLs

main
borja (aider) 3 months ago
parent 0245ef15e9
commit 8663bbf1a8

@ -176,6 +176,13 @@ export class WebhookManager {
throw new Error('WEBHOOK_URL is not set'); throw new Error('WEBHOOK_URL is not set');
} }
// Skip self-test in production if using internal URL
if (process.env.NODE_ENV === 'production' &&
process.env.WEBHOOK_URL.startsWith('http://srv-captain--')) {
console.log(' Skipping self-test for internal production URL');
return true;
}
console.log(' Testing webhook endpoint:', process.env.WEBHOOK_URL); console.log(' Testing webhook endpoint:', process.env.WEBHOOK_URL);
const testPayload = { const testPayload = {
@ -189,6 +196,7 @@ export class WebhookManager {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify(testPayload), body: JSON.stringify(testPayload),
timeout: 5000 // Add timeout to prevent hanging
}); });
if (!response.ok) { if (!response.ok) {

Loading…
Cancel
Save