From 7c51d88501adafa592bbe3188806c7621d58a250 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Thu, 29 Aug 2024 08:45:04 +0200 Subject: [PATCH] Add stub for Footprint update service --- internal/taskManager/footprintService.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/internal/taskManager/footprintService.go b/internal/taskManager/footprintService.go index 28a5a72..ba1fb09 100644 --- a/internal/taskManager/footprintService.go +++ b/internal/taskManager/footprintService.go @@ -4,5 +4,22 @@ // license that can be found in the LICENSE file. package taskManager +import ( + "time" + + "github.com/ClusterCockpit/cc-backend/pkg/log" + "github.com/go-co-op/gocron/v2" +) + func registerFootprintWorker() { + log.Info("Register Footprint Update service") + d, _ := time.ParseDuration("10m") + s.NewJob(gocron.DurationJob(d), + gocron.NewTask( + func() { + t := time.Now() + log.Printf("Update Footprints started at %s", t.Format(time.RFC3339)) + + log.Print("Update Footprints done") + })) }