409
func splitBufferedStartsForLegacy(
410
starts []*schedulespb.BufferedStart,
411
>
) ([]*schedulespb.BufferedStart, []*commonpb.WorkflowExecution, []*schedulepb.ScheduleActionResult) {
migration.go
412
>
if len(starts) == 0 {
413
return nil, nil, nil
414
}
415
416
>
var buffered []*schedulespb.BufferedStart
migration.go
417
>
var running []*commonpb.WorkflowExecution
418
>
var recent []*schedulepb.ScheduleActionResult
419
>
420
>
for _, start := range starts {
421
>
if start.GetRunId() == "" && start.GetCompleted() == nil {
422
buffered = append(buffered, common.CloneProto(start))
423
continue
424
}
425
427
continue
428
}
429
430
>
status := enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING
migration.go
431
>
if start.GetCompleted() != nil {
432
>
status = start.GetCompleted().GetStatus()
433
>
}
434
435
>
recent = append(recent, &schedulepb.ScheduleActionResult{
migration.go
436
>
ScheduleTime: start.GetActualTime(),
437
>
ActualTime: start.GetStartTime(),
438
>
StartWorkflowResult: &commonpb.WorkflowExecution{
439
>
WorkflowId: start.GetWorkflowId(),
440
>
RunId: start.GetRunId(),
441
>
},
442
>
StartWorkflowStatus: status,
443
>
})
444
>
445
>
if start.GetCompleted() == nil {
446
>
running = append(running, &commonpb.WorkflowExecution{
447
>
WorkflowId: start.GetWorkflowId(),
448
>
RunId: start.GetRunId(),
449
>
})
450
>
}
451
}
452
454
}
455