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