diff --git a/main.go b/main.go index 7d9cf39..5e9decc 100644 --- a/main.go +++ b/main.go @@ -38,9 +38,11 @@ func main() { cycle() } +const timezoneOffset = -3 + func cycle() { now := time.Now() - lastWeek := now.Add(-time.Hour * 24 * time.Duration(now.Weekday()-time.Monday)) + lastWeek := now.Add(-time.Hour*24*time.Duration(now.Weekday()-time.Monday) + 8 - timezoneOffset) if now.Weekday() > time.Sunday { err := createIfNotExists(lastWeek.Format("semana 2006-01-02")) if err != nil { @@ -48,7 +50,7 @@ func cycle() { } } - time.Sleep(time.Hour * 5) + time.Sleep(time.Minute * 10) cycle() }