feat: improve timeouts for webhooks (#29066)

This commit is contained in:
Rodrigo Mansueli authored and Crispy1975 committed 2024-10-16 12:54:48 +01:00
1 parent c04d86a5db
commit 8059e2dedb
1 file changed
+3 -3
@@ -92,7 +92,7 @@ const EditHookPanel = ({ visible, selectedHook, onClose }: EditHookPanelProps) =
function_type: isEdgeFunction(selectedHook?.function_args?.[0] ?? '')
? 'supabase_function'
: 'http_request',
timeout_ms: Number(selectedHook?.function_args?.[4] ?? 1000),
timeout_ms: Number(selectedHook?.function_args?.[4] ?? 5000),
}
useEffect(() => {
@@ -165,8 +165,8 @@ const EditHookPanel = ({ visible, selectedHook, onClose }: EditHookPanelProps) =
}
}
if (values.timeout_ms < 1000 || values.timeout_ms > 5000) {
errors['timeout_ms'] = 'Timeout should be between 1000ms and 5000ms'
if (values.timeout_ms < 1000 || values.timeout_ms > 10_000) {
errors['timeout_ms'] = 'Timeout should be between 1000ms and 10,000ms'
}
if (JSON.stringify(values) !== JSON.stringify(initialValues)) setIsEdited(true)