Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/core/ingest/git_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def _do_clone_sync(url: str, repo_dir: Path, depth: int = 1) -> None:
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
timeout=120,
timeout=1800,
)
except subprocess.TimeoutExpired:
raise GitIngestError(
f"Git clone timed out after 120 s for {url}. "
f"Git clone timed out after 1800 s for {url}. "
"Try a smaller or less active repository.",
error_code="CLONE_TIMEOUT",
)
Expand Down
23 changes: 14 additions & 9 deletions frontend/src/components/ingest/GitHubInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ingestGitHub } from "../../api/ingest";
import { useSessionStore } from "../../store/sessionStore";
import { useUiStore } from "../../store/uiStore";

const CLONE_TIMEOUT_MS = 120_000;
const CLONE_TIMEOUT_MS = 600_000;

export function GitHubInput() {
const [url, setUrl] = useState("");
Expand All @@ -28,18 +28,20 @@ export function GitHubInput() {
setError(null);
setSessionError(null);

const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), CLONE_TIMEOUT_MS);

try {
const data = await ingestGitHub(url.trim(), controller.signal);
clearTimeout(timeoutId);
const data = await ingestGitHub(url.trim());
setSessionAndLoading(data);
setShowIngestModal(false);
} catch (err: unknown) {
clearTimeout(timeoutId);
setIsLoading(false);

if (
err instanceof Error &&
(err.message.toLowerCase() === "canceled" ||
err.message.toLowerCase() === "cancelled")
) {
setError("Clone operation was cancelled or timed out.");
return;
}
// AbortError from our 120s timeout
if (err instanceof DOMException && err.name === "AbortError") {
setError("Clone timed out. The repository might be too large or the network is slow.");
Expand All @@ -65,7 +67,10 @@ export function GitHubInput() {
} else {
setError(`Server error (${status ?? "unknown"}). Please try again.`);
}
} else if (err && typeof err === "object" && "request" in err) {
} else if (err &&
typeof err === "object" &&
"request" in err &&
!(err instanceof DOMException)) {

setError("Cannot reach the server. Is the backend running on port 8000?");
} else if (
Expand Down
Loading