debug
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: map[string]*workflow_execution.WorkflowExecution{}}
|
||||
var Bookings = ScheduledBooking{Bookings: []*workflow_execution.WorkflowExecution{}}
|
||||
|
||||
type ExecutionManager struct{}
|
||||
|
||||
@@ -21,11 +21,12 @@ func (em *ExecutionManager) RetrieveNextExecutions() {
|
||||
logger.Debug().Msg("New loop")
|
||||
Bookings.Mu.Lock()
|
||||
if len(Bookings.Bookings) > 0 {
|
||||
for k, v := range Bookings.Bookings {
|
||||
if v.ExecDate.Before(time.Now().UTC()) {
|
||||
logger.Info().Msg("Will execute " + k + " soon")
|
||||
go em.executeBooking(v)
|
||||
delete(Bookings.Bookings, k)
|
||||
bookings := Bookings.Bookings
|
||||
for i := len(bookings) - 1; i >= 0; i-- {
|
||||
if bookings[i].ExecDate.Before(time.Now().UTC()) {
|
||||
logger.Info().Msg("Will execute " + bookings[i].UUID + " soon")
|
||||
go em.executeBooking(bookings[i])
|
||||
Bookings.Bookings = append(bookings[:i], bookings[i+1:]...)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user