MCPcopy Create free account
hub / github.com/temporalio/temporal / assertCurrentExecution

Function assertCurrentExecution

common/persistence/sql/execution_util.go:1011–1031  ·  view source on GitHub ↗
(
	ctx context.Context,
	tx sqlplugin.Tx,
	shardID int32,
	namespaceID primitives.UUID,
	workflowID string,
	archetypeID chasm.ArchetypeID,
	assertFn func(currentRow *sqlplugin.CurrentExecutionsRow) error,
)

Source from the content-addressed store, hash-verified

1009}
1010
1011func assertCurrentExecution(
1012 ctx context.Context,
1013 tx sqlplugin.Tx,
1014 shardID int32,
1015 namespaceID primitives.UUID,
1016 workflowID string,
1017 archetypeID chasm.ArchetypeID,
1018 assertFn func(currentRow *sqlplugin.CurrentExecutionsRow) error,
1019) error {
1020
1021 currentRow, err := tx.LockCurrentExecutions(ctx, sqlplugin.CurrentExecutionsFilter{
1022 ShardID: shardID,
1023 NamespaceID: namespaceID,
1024 WorkflowID: workflowID,
1025 ArchetypeID: archetypeID,
1026 })
1027 if err != nil {
1028 return serviceerror.NewUnavailablef("assertCurrentExecution failed. Unable to load current record. Error: %v", err)
1029 }
1030 return assertFn(currentRow)
1031}
1032
1033func assertRunIDMismatch(requestRunID primitives.UUID, currentRow *sqlplugin.CurrentExecutionsRow, serializer serialization.Serializer) error {
1034 // zombie workflow creation with existence of current record, this is a noop

Callers 1

Calls 1

LockCurrentExecutionsMethod · 0.65

Tested by

no test coverage detected