Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration to throw an exception when an orchestration is in an existing dedupe state #334

Merged
merged 2 commits into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,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