|
@@ -33,7 +33,7 @@ import (
|
|
|
)
|
|
|
|
|
|
func CronScheduled(ctx context.Context) {
|
|
|
- os.Setenv("TZ", "Asia/Shanghai")
|
|
|
+
|
|
|
tx := restful.Engine.NewSession()
|
|
|
defer tx.Close()
|
|
|
|
|
@@ -1085,19 +1085,8 @@ func processAnalysisEarlyWarning(target []string, pastureId string, serviceId in
|
|
|
}
|
|
|
|
|
|
func manualUdData(pastureinfo *udPastureInfo) {
|
|
|
-
|
|
|
- shanghaiLoc, err := time.LoadLocation("Asia/Shanghai")
|
|
|
- if err != nil {
|
|
|
- log.Printf("警告: 加载上海时区失败: %v", err)
|
|
|
- shanghaiLoc = time.Local
|
|
|
- }
|
|
|
-
|
|
|
- // 创建带时区的cron实例
|
|
|
- c := cron.New(cron.WithLocation(shanghaiLoc))
|
|
|
-
|
|
|
-
|
|
|
- // c := cron.New()
|
|
|
- c.AddFunc("10 06 * * *", func() {
|
|
|
+ c := cron.New()
|
|
|
+ c.AddFunc("10 13 * * *", func() {
|
|
|
tx := restful.Engine.NewSession()
|
|
|
defer tx.Close()
|
|
|
now := time.Now().AddDate(0, 0, -1).Format("2006-01-02")
|