Refactor Scraper Configuration and Command Line Handling
- Removed command line flag parsing for date range scraping in the scraper's main function. - Introduced configuration fields for one-time scraping and date range (FromDate, ToDate) in the ScraperConfig struct. - Updated the main function to utilize the new configuration fields, improving the clarity and maintainability of the scraping logic. - This change enhances the scraper's functionality by centralizing configuration management and reducing command line complexity.
This commit is contained in:
@@ -24,4 +24,7 @@ type ScraperConfig struct {
|
||||
DownloadDir string `env:"TED_DOWNLOAD_DIR" envDefault:"./downloads"`
|
||||
CleanupAfter time.Duration `env:"TED_CLEANUP_AFTER" envDefault:"24h"`
|
||||
ScrapingInterval string `env:"TED_SCRAPING_INTERVAL" envDefault:"* * 10 * * *"`
|
||||
OneTime bool `env:"TED_ONE_TIME" envDefault:"false"`
|
||||
FromDate string `env:"TED_FROM_DATE" envDefault:"02/01/2025"`
|
||||
ToDate string `env:"TED_TO_DATE" envDefault:"13/09/2025"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user