added functionality to limit the maximum number of notices per day
This commit is contained in:
@@ -91,6 +91,7 @@ func InitTEDScraper(config Config, mongoManager *mongo.ConnectionManager, appLog
|
||||
CleanupAfter: config.TED.CleanupAfter,
|
||||
ScrapingInterval: config.TED.ScrapingInterval,
|
||||
AlertMail: config.AlertMail,
|
||||
MaxNoticesPerDay: config.TED.MaxNoticesPerDay,
|
||||
},
|
||||
appLogger,
|
||||
mongoManager,
|
||||
@@ -189,6 +190,7 @@ func RunOneTimeScraping(
|
||||
CleanupAfter: config.TED.CleanupAfter,
|
||||
ScrapingInterval: config.TED.ScrapingInterval,
|
||||
AlertMail: config.AlertMail,
|
||||
MaxNoticesPerDay: config.TED.MaxNoticesPerDay,
|
||||
}
|
||||
|
||||
// Initialize TED scraper
|
||||
|
||||
@@ -27,4 +27,5 @@ type ScraperConfig struct {
|
||||
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"`
|
||||
MaxNoticesPerDay int `env:"TED_MAX_NOTICES_PER_DAY" envDefault:"0"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user