Skip to content

Commit

Permalink
Configuration to throw an exception when an orchestration is in an ex…
Browse files Browse the repository at this point in the history
…isting dedupe state (#334)
  • Loading branch information
amdeel authored Oct 31, 2019
1 parent 271aa60 commit 05f4648
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,11 @@ public async Task CreateTaskOrchestrationAsync(TaskMessage creationMessage, Orch
if (existingInstance != null && dedupeStatuses != null && dedupeStatuses.Contains(existingInstance.OrchestrationStatus))
{
// An instance in this state already exists.
if (settings.ThrowExceptionOnInvalidDedupeStatus)
{
throw new InvalidOperationException($"An Orchestration instance with the status {existingInstance.OrchestrationStatus} already exists.");
}

return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ public class AzureStorageOrchestrationServiceSettings
/// </summary>
public BehaviorOnContinueAsNew EventBehaviourForContinueAsNew { get; set; } = BehaviorOnContinueAsNew.Carryover;

/// <summary>
/// When true, will throw an exception when attempting to create an orchestration with an existing dedupe status.
/// </summary>
public bool ThrowExceptionOnInvalidDedupeStatus { get; set; } = false;

/// <summary>
/// Returns bool indicating is the TrackingStoreStorageAccount has been set.
/// </summary>
Expand Down

0 comments on commit 05f4648

Please sign in to comment.