Skip to content

Commit 348c104

Browse files
Merge pull request #919 from PHOENIXCONTACT/port/FixAwaitJobEventsOnShutdownToFuture
Fix conflicting job states after restart
2 parents 2499fbd + c6da7fb commit 348c104

File tree

1 file changed

+5
-0
lines changed
  • src/Moryx.ControlSystem.ProcessEngine/Jobs/Implementation

1 file changed

+5
-0
lines changed

src/Moryx.ControlSystem.ProcessEngine/Jobs/Implementation/JobManager.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public void Start()
7777
public void Stop()
7878
{
7979
_running = false;
80+
// wait until all events are processed
81+
while (_taskQueue.PendingElements > 0)
82+
{
83+
Thread.Sleep(1);
84+
}
8085
}
8186

8287
/// <inheritdoc />

0 commit comments

Comments
 (0)