From 0f6bd3c7e3aed359306d9adb2bb7e50a44183630 Mon Sep 17 00:00:00 2001 From: Nulo Date: Wed, 31 May 2023 17:15:27 -0300 Subject: [PATCH] correr a las 8 am --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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() }