Skip to content

Commit

Permalink
cron workflows must return canceled error explicitly (#1363)
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex authored Feb 23, 2024
1 parent 803380c commit 4bafd25
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flow/workflows/scheduled_flows.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import (

// RecordSlotSizeWorkflow monitors replication slot size
func RecordSlotSizeWorkflow(ctx workflow.Context) error {
if ctx.Err() != nil {
return ctx.Err()
}
ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
StartToCloseTimeout: time.Hour,
})
Expand All @@ -19,6 +22,9 @@ func RecordSlotSizeWorkflow(ctx workflow.Context) error {

// HeartbeatFlowWorkflow sends WAL heartbeats
func HeartbeatFlowWorkflow(ctx workflow.Context) error {
if ctx.Err() != nil {
return ctx.Err()
}
ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
StartToCloseTimeout: time.Hour,
})
Expand Down

0 comments on commit 4bafd25

Please sign in to comment.