oc-schedulerd/main.go
2024-11-07 13:35:16 +01:00

31 lines
547 B
Go

package main
import (
"fmt"
"oc-schedulerd/conf"
"oc-schedulerd/daemons"
oclib "cloud.o-forge.io/core/oc-lib"
)
func main() {
oclib.InitDaemon("oc-schedulerd")
oclib.SetConfig(
conf.GetConfig().MongoUrl,
conf.GetConfig().DBName,
conf.GetConfig().NatsUrl,
conf.GetConfig().LokiUrl,
conf.GetConfig().Logs,
)
sch_mngr := daemons.ScheduleManager{Logger: oclib.GetLogger()}
exe_mngr := daemons.ExecutionManager{}
go sch_mngr.ListenNATS()
go sch_mngr.SchedulePolling()
exe_mngr.RetrieveNextExecutions()
fmt.Print("stop")
}