Skip to content

Commit

Permalink
Increases times and removes comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Nov 17, 2023
1 parent 2ecf891 commit 6179b75
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 10 additions & 4 deletions flow/activities/flowable.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,19 +672,25 @@ func (a *FlowableActivity) SendWALHeartbeat(ctx context.Context, config *protos.
return fmt.Errorf("failed to get destination connector: %w", err)
}
defer connectors.CloseConnector(srcConn)

ticker := time.NewTicker(10 * time.Second)
log.WithFields(log.Fields{"flowName": config.FlowJobName}).Info("sending walheartbeat every 10 minutes")
ticker := time.NewTicker(10 * time.Minute)
for {
select {
case <-ctx.Done():
log.Info("context is done, exiting wal heartbeat send loop")
log.WithFields(
log.Fields{
"flowName": config.FlowJobName,
}).Info("context is done, exiting wal heartbeat send loop")
return nil
case <-ticker.C:
err = srcConn.SendWALHeartbeat()
if err != nil {
return fmt.Errorf("failed to send WAL heartbeat: %w", err)
}
log.Info("sent wal heartbeat")
log.WithFields(
log.Fields{
"flowName": config.FlowJobName,
}).Info("sent wal heartbeat")
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions flow/workflows/cdc_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,9 @@ func CDCFlowWorkflowWithConfig(

heartbeatCancelCtx, cancelHeartbeat := workflow.WithCancel(ctx)
walHeartbeatCtx := workflow.WithActivityOptions(heartbeatCancelCtx, workflow.ActivityOptions{
StartToCloseTimeout: 5 * time.Minute,
StartToCloseTimeout: 7 * 24 * time.Hour,
})
workflow.ExecuteActivity(walHeartbeatCtx, flowable.SendWALHeartbeat, cfg)
//walHeartbeatFuture.Get(ctx, nil)

syncFlowOptions := &protos.SyncFlowOptions{
BatchSize: int32(limits.MaxBatchSize),
Expand Down

0 comments on commit 6179b75

Please sign in to comment.