Skip to content

Commit

Permalink
set proper wait activity timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Jan 2, 2024
1 parent 7fbf257 commit a96aa73
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flow/workflows/qrep_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,14 @@ func (q *QRepFlowExecution) consolidatePartitions(ctx workflow.Context) error {
func (q *QRepFlowExecution) waitForNewRows(ctx workflow.Context, lastPartition *protos.QRepPartition) error {
q.logger.Info("idling until new rows are detected")

waitActivityTimeout := 5 * time.Minute
if q.config.WaitBetweenBatchesSeconds > 300 {
timeGap := 60
waitActivityTimeout = time.Duration(q.config.WaitBetweenBatchesSeconds+uint32(timeGap)) * time.Second
}
ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
StartToCloseTimeout: 16 * 365 * 24 * time.Hour, // 16 years
HeartbeatTimeout: 5 * time.Minute,
HeartbeatTimeout: waitActivityTimeout,
})

if err := workflow.ExecuteActivity(ctx, flowable.QRepWaitUntilNewRows, q.config,
Expand Down

0 comments on commit a96aa73

Please sign in to comment.