woodpecker-autoscaler/cmd/woodpecker-autoscaler.go
Tobias Trabelsi e615144396
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
added models and getting information from woodpecker
2023-10-30 22:46:17 +01:00

41 lines
922 B
Go

package main
import (
"fmt"
"time"
"git.uploadfilter24.eu/covidnetes/woodpecker-autoscaler/internal/config"
"git.uploadfilter24.eu/covidnetes/woodpecker-autoscaler/internal/health"
"git.uploadfilter24.eu/covidnetes/woodpecker-autoscaler/internal/logging"
"git.uploadfilter24.eu/covidnetes/woodpecker-autoscaler/internal/woodpecker"
log "github.com/sirupsen/logrus"
)
func main() {
cfg, err := config.GenConfig()
logging.ConfigureLogger(cfg)
if err != nil {
log.WithFields(log.Fields{
"Caller": "Main",
}).Fatal(fmt.Sprintf("Error generating Config: %s", err.Error()))
}
go func() {
log.WithFields(log.Fields{
"Caller": "Main",
}).Info("Starting Health Endpoint")
health.StartHealthEndpoint()
}()
log.WithFields(log.Fields{
"Caller": "Main",
}).Info("Entering main event loop")
for {
woodpecker.CheckPending(cfg)
time.Sleep(time.Duration(cfg.CheckInterval) * time.Minute)
}
}