SCRAPE-3: Implement fetchPage() with axios, timeout, retry (#8)
Co-authored-by: Stephen Minakian <stephenminakian@gmail.com> Co-committed-by: Stephen Minakian <stephenminakian@gmail.com>
This commit is contained in:
@ -17,14 +17,14 @@ module.exports = {
|
||||
SCRAPER_ENABLED: process.env.SCRAPER_ENABLED !== 'false',
|
||||
|
||||
// HTTP settings
|
||||
SCRAPER_TIMEOUT: parseInt(process.env.SCRAPER_TIMEOUT) || 30000,
|
||||
SCRAPER_TIMEOUT: parseInt(process.env.SCRAPER_TIMEOUT, 10) || 30000,
|
||||
USER_AGENT: 'Mozilla/5.0 (compatible; ApartmentScraper/1.0)',
|
||||
|
||||
// Retry configuration for HTTP requests
|
||||
RETRY_CONFIG: {
|
||||
maxRetries: 3,
|
||||
baseDelay: 1000, // 1 second, exponential backoff: 1s, 2s, 4s
|
||||
timeout: parseInt(process.env.SCRAPER_TIMEOUT) || 30000
|
||||
timeout: parseInt(process.env.SCRAPER_TIMEOUT, 10) || 30000
|
||||
},
|
||||
|
||||
// MongoDB collection names (environment variable overrides for development isolation)
|
||||
|
||||
Reference in New Issue
Block a user