Compare commits
	
		
			6 Commits
		
	
	
		
			443546027b
			...
			bugfix/sch
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					d4139fa270 | ||
| 
						 | 
					db09d2ea89 | ||
| 
						 | 
					e79e909805 | ||
| 
						 | 
					f7e4e11705 | ||
| 
						 | 
					77554cbcf5 | ||
| 
						 | 
					0783395121 | 
@@ -1,6 +1,7 @@
 | 
			
		||||
package workflow_execution
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"errors"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"strings"
 | 
			
		||||
@@ -153,6 +154,9 @@ func (ws *WorkflowSchedule) getExecutions(workflow *workflow.Workflow) ([]*Workf
 | 
			
		||||
		return workflows_executions, err
 | 
			
		||||
	}
 | 
			
		||||
	for _, date := range dates {
 | 
			
		||||
		fmt.Println("============")
 | 
			
		||||
		fmt.Println("Date : " + fmt.Sprint(date))
 | 
			
		||||
		fmt.Println("============")
 | 
			
		||||
		obj := &WorkflowExecution{
 | 
			
		||||
			AbstractObject: utils.AbstractObject{
 | 
			
		||||
				UUID: uuid.New().String(),                                 // set the uuid of the execution
 | 
			
		||||
@@ -189,8 +193,17 @@ func (ws *WorkflowSchedule) getDates() ([]Schedule, error) {
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return schedule, errors.New("Bad cron message: " + err.Error())
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		toto, _ := json.MarshalIndent(sched,"","")
 | 
			
		||||
		fmt.Println(string(toto))
 | 
			
		||||
		s := sched.Next(ws.Start)
 | 
			
		||||
		fmt.Println("s.IsZero() : " + fmt.Sprint(s.IsZero()) + "s.Before(*ws.End) : " +  fmt.Sprint(s.Before(*ws.End)) )
 | 
			
		||||
		tata, _ := json.MarshalIndent(s,"","")
 | 
			
		||||
		fmt.Println("s = " + string(tata) + " et ws.End = " + fmt.Sprint(ws.End))
 | 
			
		||||
 | 
			
		||||
		// loop through the cron schedule to set the executions
 | 
			
		||||
		for s := sched.Next(ws.Start); !s.IsZero() && s.Before(*ws.End); s = sched.Next(s) {
 | 
			
		||||
			fmt.Println("next execution :" + fmt.Sprint(s))
 | 
			
		||||
			e := s.Add(time.Duration(ws.DurationS) * time.Second)
 | 
			
		||||
			schedule = append(schedule, Schedule{
 | 
			
		||||
				Start: s,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user