-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCrawlerOptions.cs
More file actions
38 lines (32 loc) · 961 Bytes
/
CrawlerOptions.cs
File metadata and controls
38 lines (32 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
namespace SmartCrawler;
/**
* Depth options form a single setup object
*/
public struct CrawlingDepthOptions
{
public int CrawlingDepth;
public bool VisitCrossDomain;
public CrawlingDepthOptions(int crawlingDepth, bool visitCrossDomain)
{
CrawlingDepth = crawlingDepth;
VisitCrossDomain = visitCrossDomain;
}
}
public struct CrawlerOptions
{
public CrawlingDepthOptions? DepthOptions;
/// <summary>
/// Number of tasks that will be ran in parallel
/// </summary>
public int ParallelCrawlers;
/// <summary>
/// the maximum number of requests to the same URL that can result with a noncritical error
/// </summary>
public int MaxRetries;
public CrawlerOptions(int parallelCrawlers = 1, int maxRetries = 0, CrawlingDepthOptions? depthOptions = null)
{
DepthOptions = depthOptions;
ParallelCrawlers = parallelCrawlers;
MaxRetries = maxRetries;
}
}