Refactor MongoDB index creation to use NonEmptyStringPartialFilter for improved clarity and consistency. Update GetOJS function to utilize context and user agent for HTTP requests, enhancing error handling and response management.
This commit is contained in:
+1
-1
@@ -525,7 +525,7 @@ func (s *TEDScraper) processSingleDate(ctx context.Context, date time.Time) erro
|
||||
})
|
||||
|
||||
// get ojs
|
||||
ojs, err := GetOJS(s.config.BaseURL, date.Year(), date.Format("02/01/2006"), s.httpClient)
|
||||
ojs, err := GetOJS(ctx, s.config.BaseURL, date.Year(), date.Format("02/01/2006"), s.config.UserAgent, s.httpClient)
|
||||
if err != nil {
|
||||
s.logger.Error("Failed to get OJS", map[string]interface{}{
|
||||
"date": date.Format("02/01/2006"),
|
||||
|
||||
Reference in New Issue
Block a user