package main

import (
	"github.com/sirupsen/logrus"
	"lc/common/models"
	"time"
)
import "github.com/robfig/cron"

func calcTask() {
	hourSpec := "0 0 */1 * * ?"
	//minuteSpec := "0 */15 * * * ?"
	daySpec := "0 0 1 * * ?"
	c := cron.New()
	_ = c.AddFunc(hourSpec, func() {
		err := models.StatHourRadarData(time.Now())
		logrus.Debugf("StatHourRadarData err：%v", err)
	})

	_ = c.AddFunc(daySpec, func() {
		err := models.StatDayRadarData(time.Now())
		logrus.Debugf("StatDayRadarData err：%v", err)
	})

	c.Start()
}
