solar: Collect metrics periodically

This commit is contained in:
2025-04-12 19:37:33 +05:30
parent 7627d48aaf
commit ae1c064e52
2 changed files with 77 additions and 39 deletions

View File

@@ -52,7 +52,8 @@ func main() {
solar := internal.NewSolar(client, deyeUser, deyePassword)
myCron := cron.New()
myCron.AddFunc("0 0 18 * * *", solar.SendDailyReport)
myCron.AddFunc("0 0 18 * * *", solar.CronSendDailyReport)
myCron.AddFunc("0 */15 * * * *", solar.CronCollectMetrics)
myCron.Start()
// Listen to Ctrl+C (you can also do something else that prevents the program from exiting)