Skip to content

Commit 7b10eba

Browse files
committed
feat: increase default maxPages and add constants
- Increase default maxPages from 100 to 1000 - Add DEFAULT_MAX_PAGES and DEFAULT_MAX_DEPTH constants - Replace magic numbers with constants Closes #43
1 parent 3ed31cc commit 7b10eba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/tools/ScrapeTool.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import type { DocumentManagementService } from "../store/DocumentManagementServi
44
import type { ProgressResponse } from "../types"; // Keep for options interface, though onProgress is removed from internal logic
55
import { logger } from "../utils/logger";
66

7+
// Default values for scraping configuration
8+
const DEFAULT_MAX_PAGES = 1000;
9+
const DEFAULT_MAX_DEPTH = 3;
10+
711
export interface ScrapeToolOptions {
812
library: string;
913
version?: string | null; // Make version optional
@@ -115,8 +119,8 @@ export class ScrapeTool {
115119
version: internalVersion,
116120
scope: scraperOptions?.scope ?? "subpages",
117121
followRedirects: scraperOptions?.followRedirects ?? true,
118-
maxPages: scraperOptions?.maxPages ?? 100,
119-
maxDepth: scraperOptions?.maxDepth ?? 3,
122+
maxPages: scraperOptions?.maxPages ?? DEFAULT_MAX_PAGES,
123+
maxDepth: scraperOptions?.maxDepth ?? DEFAULT_MAX_DEPTH,
120124
// maxConcurrency is handled by the manager itself now
121125
ignoreErrors: scraperOptions?.ignoreErrors ?? true,
122126
});

0 commit comments

Comments
 (0)