I had an issue when worker I stop it and rerun it … with this code …
selector := workflow.NewSelector(ctx)
newDuration := req.Times.Sub(time.Now().Local())
timerFuture := workflow.NewTimer(ctx, newDuration)
selector.AddFuture(timerFuture, func(f workflow.Future) {
errExe := workflow.ExecuteActivity(ctx, libs.ActivityGeneral, req).Get(ctx, &resp)
if errExe != nil {
errorStr := strings.Split(errExe.Error(), "):")
if strings.TrimSpace(errorStr[1]) == libs.FailedMethod || strings.TrimSpace(errorStr[1]) == libs.FailedTask {
err = errExe
} else {
execution := workflow.GetInfo(ctx).WorkflowExecution
childID := fmt.Sprintf("retry_workflow:%v", execution.RunID)
cwo := workflow.ChildWorkflowOptions{
WorkflowID: childID,
}
ctx = workflow.WithChildOptions(ctx, cwo)
errChild := workflow.ExecuteChildWorkflow(ctx, RetryWorkflow, req).Get(ctx, &resp)
if errChild != nil {
qoingohelper.LoggerError(errChild)
err = errChild
}
}
}
})
ctx = actvityOption(ctx, req)
selector.Select(ctx)
return
I give it like a time delay for a minute , in the middle of a time i stop the worker and run it again
, its giving me an error “nondeterministic workflow definition code or incompatible change in the workflow definition” …
do I wrong using selector , or any solution …
if worker running without interruption , worker will be fine …