-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix WorkflowLaunchpad correlation locking
This fixes an issue where there was a brief moment of opportunity for callers to create duplicate workflow instances. It also fixes duplicate workflow instances by not only querying for suspended workflows, but any other "unfinished" state workflows
- Loading branch information
1 parent
6d0fc33
commit 26bf218
Showing
4 changed files
with
128 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
....Core/Persistence/Specifications/WorkflowInstances/WorkflowFinishedStatusSpecification.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
using System.Linq.Expressions; | ||
using Elsa.Models; | ||
|
||
namespace Elsa.Persistence.Specifications.WorkflowInstances | ||
{ | ||
public class WorkflowFinishedStatusSpecification : Specification<WorkflowInstance> | ||
{ | ||
public override Expression<Func<WorkflowInstance, bool>> ToExpression() => x => x.WorkflowStatus == WorkflowStatus.Cancelled || x.WorkflowStatus == WorkflowStatus.Faulted || x.WorkflowStatus == WorkflowStatus.Finished; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ore/Persistence/Specifications/WorkflowInstances/WorkflowUnfinishedStatusSpecification.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
using System.Linq.Expressions; | ||
using Elsa.Models; | ||
|
||
namespace Elsa.Persistence.Specifications.WorkflowInstances | ||
{ | ||
public class WorkflowUnfinishedStatusSpecification : Specification<WorkflowInstance> | ||
{ | ||
public override Expression<Func<WorkflowInstance, bool>> ToExpression() => x => x.WorkflowStatus == WorkflowStatus.Idle || x.WorkflowStatus == WorkflowStatus.Running || x.WorkflowStatus == WorkflowStatus.Suspended; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters