git push origin launch
Merge branch 'helloannali-feature/fix-schedule-when-init-branch-launch' into launch
This commit is contained in:
@@ -2,7 +2,7 @@ module shuffle
|
||||
|
||||
go 1.13
|
||||
|
||||
//replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared
|
||||
replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared
|
||||
|
||||
//replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi
|
||||
|
||||
|
||||
+13
-11
@@ -3973,17 +3973,11 @@ func runInitEs(ctx context.Context) {
|
||||
log.Printf("[WARNING] Failed getting schedules during service init: %s", err)
|
||||
} else {
|
||||
log.Printf("[INFO] Setting up %d schedule(s)", len(schedules))
|
||||
url := &url.URL{}
|
||||
for _, schedule := range schedules {
|
||||
if schedule.Environment == "cloud" {
|
||||
log.Printf("Skipping cloud schedule")
|
||||
continue
|
||||
}
|
||||
|
||||
//log.Printf("Schedule: %#v", schedule)
|
||||
job := func() {
|
||||
//log.Printf("[INFO] Running schedule %s with interval %d.", schedule.Id, schedule.Seconds)
|
||||
//log.Printf("ARG: %s", schedule.WrappedArgument)
|
||||
url := &url.URL{}
|
||||
job := func(schedule shuffle.ScheduleOld) func() {
|
||||
return func() {
|
||||
log.Printf("[INFO] Running schedule %s with interval %d.", schedule.Id, schedule.Seconds)
|
||||
|
||||
request := &http.Request{
|
||||
URL: url,
|
||||
@@ -3996,9 +3990,17 @@ func runInitEs(ctx context.Context) {
|
||||
log.Printf("[WARNING] Failed to execute %s: %s", schedule.WorkflowId, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for _, schedule := range schedules {
|
||||
if schedule.Environment == "cloud" {
|
||||
log.Printf("Skipping cloud schedule")
|
||||
continue
|
||||
}
|
||||
|
||||
//log.Printf("Schedule: %#v", schedule)
|
||||
//log.Printf("Schedule time: every %d seconds", schedule.Seconds)
|
||||
jobret, err := newscheduler.Every(schedule.Seconds).Seconds().NotImmediately().Run(job)
|
||||
jobret, err := newscheduler.Every(schedule.Seconds).Seconds().NotImmediately().Run(job(schedule))
|
||||
if err != nil {
|
||||
log.Printf("Failed to schedule workflow: %s", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user