working oc-schedulerd
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
workflow_execution "cloud.o-forge.io/core/oc-lib/models/workflow_execution"
|
||||
)
|
||||
|
||||
var Bookings = ScheduledBooking{Bookings: []*workflow_execution.WorkflowExecution{}}
|
||||
var Bookings = ScheduledBooking{Bookings: []*workflow_execution.WorkflowExecutions{}}
|
||||
|
||||
type ExecutionManager struct{}
|
||||
|
||||
@@ -35,7 +35,7 @@ func (em *ExecutionManager) RetrieveNextExecutions() {
|
||||
}
|
||||
}
|
||||
|
||||
func (em *ExecutionManager) executeBooking(booking *workflow_execution.WorkflowExecution) {
|
||||
func (em *ExecutionManager) executeBooking(booking *workflow_execution.WorkflowExecutions) {
|
||||
// start execution
|
||||
// create the yaml that describes the pod : filename, path/url to Loki
|
||||
exec_method := os.Getenv("MONITOR_METHOD")
|
||||
@@ -45,14 +45,14 @@ func (em *ExecutionManager) executeBooking(booking *workflow_execution.WorkflowE
|
||||
} else {
|
||||
logger.Debug().Msg("Executing oc-monitor localy")
|
||||
duration := 0
|
||||
if booking.EndDate != nil && booking.ExecDate != nil {
|
||||
duration = int(booking.EndDate.Sub(*booking.ExecDate).Seconds())
|
||||
if booking.EndDate != nil {
|
||||
duration = int(booking.EndDate.Sub(booking.ExecDate).Seconds())
|
||||
}
|
||||
monitor := LocalMonitor{
|
||||
Logger: logger,
|
||||
Duration: duration,
|
||||
LokiURL: conf.GetConfig().LokiUrl,
|
||||
KubeURL: "localhost",
|
||||
Logger: logger,
|
||||
Duration: duration,
|
||||
LokiURL: conf.GetConfig().LokiUrl,
|
||||
KubeURL: "localhost",
|
||||
ExecutionID: booking.UUID,
|
||||
}
|
||||
monitor.LaunchLocalMonitor()
|
||||
|
||||
Reference in New Issue
Block a user