| @@ -17,7 +17,6 @@ package cron | |||||
| import ( | import ( | ||||
| "github.com/zeromicro/go-zero/core/logx" | "github.com/zeromicro/go-zero/core/logx" | ||||
| "gitlink.org.cn/JointCloud/pcm-coordinator/internal/logic/schedule" | "gitlink.org.cn/JointCloud/pcm-coordinator/internal/logic/schedule" | ||||
| "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/service/utils/stat" | |||||
| "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/service/utils/status" | "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/service/utils/status" | ||||
| "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc" | "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc" | ||||
| ) | ) | ||||
| @@ -28,14 +27,14 @@ func AddCronGroup(svc *svc.ServiceContext) { | |||||
| UpdateAiAdapterMaps(svc) | UpdateAiAdapterMaps(svc) | ||||
| }) | }) | ||||
| svc.Cron.AddFunc("30 * * * * ?", func() { | |||||
| adapterList, err := svc.Scheduler.AiStorages.GetAdaptersByType("1") | |||||
| if err != nil { | |||||
| logx.Errorf(err.Error()) | |||||
| return | |||||
| } | |||||
| stat.UpdateClusterResources(svc, adapterList) | |||||
| }) | |||||
| //svc.Cron.AddFunc("30 * * * * ?", func() { | |||||
| // adapterList, err := svc.Scheduler.AiStorages.GetAdaptersByType("1") | |||||
| // if err != nil { | |||||
| // logx.Errorf(err.Error()) | |||||
| // return | |||||
| // } | |||||
| // stat.UpdateClusterResources(svc, adapterList) | |||||
| //}) | |||||
| svc.Cron.AddFunc("@hourly", func() { | svc.Cron.AddFunc("@hourly", func() { | ||||
| status.UpdateAutoStoppedInstance(svc) | status.UpdateAutoStoppedInstance(svc) | ||||