-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Spawns a new Workflow when Flow API starts - called `HeartbeatFlowWorkflow`. - This workflow has just one activity which sends wal heartbeat commands every 10 minutes to every Postgres peer in the catalog - Before spawning this workflow, pre-existing `HeartbearFlowWorkflow`s are cancelled. Other: Fixes a typo in UI: `snapshow` -> `snapshot`
- Loading branch information
1 parent
b7b6a8d
commit 13c1c57
Showing
5 changed files
with
153 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package peerflow | ||
|
||
import ( | ||
"time" | ||
|
||
"go.temporal.io/sdk/workflow" | ||
) | ||
|
||
// HeartbeatFlowWorkflow is the workflow that sets up heartbeat sending. | ||
func HeartbeatFlowWorkflow(ctx workflow.Context) error { | ||
|
||
ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{ | ||
StartToCloseTimeout: 7 * 24 * time.Hour, | ||
}) | ||
|
||
heartbeatFuture := workflow.ExecuteActivity(ctx, flowable.SendWALHeartbeat) | ||
if err := heartbeatFuture.Get(ctx, nil); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters