Compare commits

..

2 Commits

Author SHA1 Message Date
eleksir
7d3c083cea Fix counting errors. 2026-03-31 22:25:35 +03:00
eleksir
dbfbd6865a Fix off-by-one bug in celebratoday.go 2026-03-31 22:12:01 +03:00
2 changed files with 2 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ func APIClient() (string, error) {
// Формальная попытка притвориться браузером.
_, _, day := time.Now().Date()
userAgent := Config.UserAgents[day]
userAgent := Config.UserAgents[day-1]
if err := requests.URL(url).UserAgent(userAgent).
Header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8").

View File

@@ -25,7 +25,7 @@ func CronTask() {
log.Errorf("Unable to get holidays (try %d/15): %s", errcnt, err)
switch errcnt {
case 0, 1, 2:
case 1, 2:
timeout = 1 * time.Second
case 3, 4, 5: