Skip to content

Commit 2858f66

Browse files
authored
Merge pull request #700 from danielgerlag/issue605
issue 605
2 parents 499abf9 + bf110e3 commit 2858f66

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

src/WorkflowCore/Services/WorkflowExecutor.cs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -229,22 +229,19 @@ private async Task DetermineNextExecutionTime(WorkflowInstance workflow, Workflo
229229
workflow.NextExecution = Math.Min(pointerSleep, workflow.NextExecution ?? pointerSleep);
230230
}
231231

232-
if (workflow.NextExecution == null)
232+
foreach (var pointer in workflow.ExecutionPointers.Where(x => x.Active && (x.Children ?? new List<string>()).Count > 0))
233233
{
234-
foreach (var pointer in workflow.ExecutionPointers.Where(x => x.Active && (x.Children ?? new List<string>()).Count > 0))
235-
{
236-
if (!workflow.ExecutionPointers.FindByScope(pointer.Id).All(x => x.EndTime.HasValue))
237-
continue;
238-
239-
if (!pointer.SleepUntil.HasValue)
240-
{
241-
workflow.NextExecution = 0;
242-
return;
243-
}
234+
if (!workflow.ExecutionPointers.FindByScope(pointer.Id).All(x => x.EndTime.HasValue))
235+
continue;
244236

245-
var pointerSleep = pointer.SleepUntil.Value.ToUniversalTime().Ticks;
246-
workflow.NextExecution = Math.Min(pointerSleep, workflow.NextExecution ?? pointerSleep);
237+
if (!pointer.SleepUntil.HasValue)
238+
{
239+
workflow.NextExecution = 0;
240+
return;
247241
}
242+
243+
var pointerSleep = pointer.SleepUntil.Value.ToUniversalTime().Ticks;
244+
workflow.NextExecution = Math.Min(pointerSleep, workflow.NextExecution ?? pointerSleep);
248245
}
249246

250247
if ((workflow.NextExecution != null) || (workflow.ExecutionPointers.Any(x => x.EndTime == null)))

src/WorkflowCore/WorkflowCore.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1616
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
1717
<Description>Workflow Core is a light weight workflow engine targeting .NET Standard.</Description>
18-
<Version>3.3.0</Version>
19-
<AssemblyVersion>3.3.0.0</AssemblyVersion>
20-
<FileVersion>3.3.0.0</FileVersion>
18+
<Version>3.3.1</Version>
19+
<AssemblyVersion>3.3.1.0</AssemblyVersion>
20+
<FileVersion>3.3.1.0</FileVersion>
2121
<PackageReleaseNotes></PackageReleaseNotes>
2222
<PackageIconUrl>https://github.com/danielgerlag/workflow-core/raw/master/src/logo.png</PackageIconUrl>
23-
<PackageVersion>3.3.0</PackageVersion>
23+
<PackageVersion>3.3.1</PackageVersion>
2424
</PropertyGroup>
2525

2626
<ItemGroup>

0 commit comments

Comments
 (0)