scraper SSL fix

This commit is contained in:
m.nazemi
2026-04-12 15:11:37 +03:30
parent bf3f21fb51
commit 07320c58b0
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ FROM docker-mirror.ravanertebat.ir/base/amd64/bash:$BASH_VERSION
# RUN apk update
# # RUN apk add --upgrade busybox-suid
# RUN apk --no-cache add --update busybox-suid \
# && apk --no-cache add curl rsync tzdata tcpdump tree ca-certificates s-nail \
# && apk --no-cache add --upgrade ca-certificates curl rsync tzdata tcpdump tree s-nail \
# && ln -s /usr/bin/mail /usr/bin/s-nail \
# && mkdir -p /go/bin/media \
# && mkdir -p /go/bin/log \
+2 -2
View File
@@ -14,13 +14,13 @@ const (
)
// Get OJS Number
func GetOJS(baseURL string, year int, date string) (string, error) {
func GetOJS(baseURL string, year int, date string, client *http.Client) (string, error) {
var (
ojs string
)
url := fmt.Sprintf(calendarUrl, baseURL, year)
resp, err := http.Get(url)
resp, err := client.Get(url)
if err != nil {
return ojs, err
}
+1 -1
View File
@@ -463,7 +463,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"))
ojs, err := GetOJS(s.config.BaseURL, date.Year(), date.Format("02/01/2006"), s.httpClient)
if err != nil {
s.logger.Error("Failed to get OJS", map[string]interface{}{
"date": date.Format("02/01/2006"),