* Get the parallel count (how many scrapers can run at once) for a task. * Uses scraper_name if scraper-based rate limiting, otherwise scraper_type.
(scraperName: string, scraperType: string)
| 596 | * Uses scraper_name if scraper-based rate limiting, otherwise scraper_type. |
| 597 | */ |
| 598 | getParallelCount(scraperName: string, scraperType: string): number { |
| 599 | const key = this.isScraperBasedRateLimit ? scraperName : scraperType; |
| 600 | // @ts-ignore |
| 601 | const limit = this.rateLimit[key]; |
| 602 | // If no limit is set (null/undefined), default to 1 |
| 603 | return limit != null && limit > 0 ? limit : 1; |
| 604 | } |
| 605 | } |
| 606 | |
| 607 | export const Server = new _Server(); |