debug multiple

This commit is contained in:
mr
2024-08-20 16:14:10 +02:00
parent c5d15d32da
commit 826650487b
4 changed files with 18 additions and 10 deletions

View File

@@ -23,8 +23,7 @@ type Booking struct {
}
func (s Booking) Equals(other Booking) bool {
fmt.Println(s, other)
return s.Workflow == other.Workflow && s.Start == other.Start && s.Stop == other.Stop
return s.Workflow == other.Workflow && s.Start == other.Start
}
func (b *Booking) String() string {
@@ -111,11 +110,9 @@ func retrieveMapFromSub(message []byte) (result_map map[string]string) {
func (s *ScheduleManager) SchedulePolling() {
var sleep_time float64 = 1
for {
s.getNextScheduledWorkflows(3)
s.Logger.Info().Msg("Current list of schedules")
fmt.Println(Bookings.Bookings)
s.getNextScheduledWorkflows(1)
s.Logger.Info().Msg("Current list of schedules -------> " + fmt.Sprintf("%v", len(Bookings.Bookings)))
time.Sleep(time.Minute * time.Duration(sleep_time))
}
}
@@ -142,8 +139,8 @@ func (s *ScheduleManager) getWorfklowExecution(from time.Time, to time.Time) (ex
func (s *ScheduleManager) getNextScheduledWorkflows(minutes float64) {
start := time.Now().UTC()
end := start.Add(time.Minute * time.Duration(minutes+1)).UTC()
end := start.Add(time.Minute * time.Duration(minutes)).UTC()
start = start.Add(time.Second * time.Duration(-1)).UTC()
fmt.Printf("Getting workflows execution from %s to %s \n", start.String(), end.String())
next_wf_exec, err := s.getWorfklowExecution(start, end)