recien enviar el lunes
This commit is contained in:
parent
23e7b4fa6d
commit
9456c5e37f
1 changed files with 5 additions and 3 deletions
2
main.go
2
main.go
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue