@@ -81,16 +81,39 @@ runs:
8181 OUTPUT_FORMAT="${{ inputs.output_format }}"
8282
8383 echo "Fetching documentation from: $ENDPOINT_URL?url=$REPO_URL&source_branch=$SOURCE_BRANCH&target_branch=$TARGET_BRANCH&output_format=$OUTPUT_FORMAT"
84+ echo "Note: This request may take 15-20 minutes for large repositories..."
8485
8586 # Create temporary file for response
8687 TEMP_FILE=$(mktemp)
8788
88- # Make the API call and save response
89- response=$(curl -s -w "%{http_code}" -o "$TEMP_FILE" "$ENDPOINT_URL?url=$REPO_URL&source_branch=$SOURCE_BRANCH&target_branch=$TARGET_BRANCH&output_format=$OUTPUT_FORMAT")
89+ # Make the API call with extended timeouts for long-running requests
90+ # --max-time: Maximum time for the entire operation (30 minutes)
91+ # --connect-timeout: Maximum time for connection establishment (60 seconds)
92+ # --keepalive-time: Send keepalive probes every 60 seconds
93+ # --tcp-keepalive: Enable TCP keepalive
94+ response=$(curl -s -w "%{http_code}" -o "$TEMP_FILE" \
95+ --max-time 1800 \
96+ --connect-timeout 60 \
97+ --keepalive-time 60 \
98+ --tcp-keepalive \
99+ "$ENDPOINT_URL?url=$REPO_URL&source_branch=$SOURCE_BRANCH&target_branch=$TARGET_BRANCH&output_format=$OUTPUT_FORMAT")
90100 http_code=${response: -3}
91101
92102 echo "API response status code: $http_code"
93103
104+ # Handle timeout specifically
105+ if [ $? -eq 28 ]; then
106+ echo "Error: Request timed out after 25 minutes"
107+ echo "The repository analysis is taking longer than expected."
108+ echo "This might be due to:"
109+ echo "- Very large repository size"
110+ echo "- Complex codebase requiring extensive analysis"
111+ echo "- Server load or processing delays"
112+ echo "Please try again later or contact support if the issue persists."
113+ rm -f "$TEMP_FILE"
114+ exit 1
115+ fi
116+
94117 if [ "$http_code" = "404" ]; then
95118 echo "No documentation files were generated for this repository/branch combination."
96119 echo "This might be because:"
0 commit comments