mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-03 03:56:04 +00:00
## What changed? - Adds a new dummy workflow type to the system worker. ## Why? - See the comments on the workflow. This will be used to block a key in the workflow ID space from being written to during the process of creating a CHASM schedule, preventing a logical duplicate across separate ID spaces. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s)
29 lines
912 B
Go
29 lines
912 B
Go
package dummy
|
|
|
|
import (
|
|
"time"
|
|
|
|
"go.temporal.io/sdk/workflow"
|
|
)
|
|
|
|
const (
|
|
DummyWFTypeName = "temporal-sys-dummy-workflow"
|
|
|
|
// dummyDuration only needs to account for the duration in which the key needs
|
|
// to stay reserved.
|
|
dummyDuration = 1 * time.Hour
|
|
)
|
|
|
|
// DummyWorkflow is a sentinel workflow that hangs open for a fixed duration.
|
|
// It is used to reserve a particular key in the traditional workflow ID-space,
|
|
// as opposed to the CHASM archetype-specific ID spaces.
|
|
//
|
|
// CHASM Scheduler creates a DummyWorkflow to block a V1 schedule of the same
|
|
// logical schedule ID from being created in the workflow ID-space. The key stays
|
|
// reserved for a period to account for a fleet's potentially inconsistent view of
|
|
// the dynamic config feature flags controlling which stack schedulers are being
|
|
// created on.
|
|
func DummyWorkflow(ctx workflow.Context) error {
|
|
return workflow.Sleep(ctx, dummyDuration)
|
|
}
|