( ctx context.Context, tx sqlplugin.Tx, shardID int32, namespaceID primitives.UUID, workflowID string, archetypeID chasm.ArchetypeID, assertFn func(currentRow *sqlplugin.CurrentExecutionsRow) error, )
| 1009 | } |
| 1010 | |
| 1011 | func 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 | |
| 1033 | func assertRunIDMismatch(requestRunID primitives.UUID, currentRow *sqlplugin.CurrentExecutionsRow, serializer serialization.Serializer) error { |
| 1034 | // zombie workflow creation with existence of current record, this is a noop |
no test coverage detected