Here is the original code:
I changed as bellow: (add signal watch to repeat activity execution as I control )
if b.Activity != nil {
workflow.Go(ctx, func(ctx workflow.Context) {
for {
err := b.Activity.execute(ctx, bindings)
if err != nil {
logger.Error("activity error", err)
}
repCh := workflow.GetSignalChannel(ctx, RepeatSignalName)
var holder string
repCh.Receive(ctx, &holder)
}
})
}
I’m not sure the does the for
loop here will cause any problem?