recien enviar el lunes

This commit is contained in:
Cat /dev/Nulo 2023-03-20 21:38:42 -03:00
parent 23e7b4fa6d
commit 9456c5e37f

View file

@ -41,9 +41,11 @@ func main() {
func cycle() { func cycle() {
now := time.Now() 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))
err := createIfNotExists(lastWeek.Format("semana 2006-01-02")) if now.Weekday() > time.Sunday {
if err != nil { err := createIfNotExists(lastWeek.Format("semana 2006-01-02"))
log.Fatalln(err) if err != nil {
log.Fatalln(err)
}
} }
time.Sleep(time.Hour * 5) time.Sleep(time.Hour * 5)