Skip to content

Commit

Permalink
cancel initializing devices on DM shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Aytackydln committed Mar 24, 2024
1 parent 580d26f commit 502713a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Project-Aurora/AuroraDeviceManager/Devices/DeviceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ private static bool DeviceEnabled(DeviceContainer dc)

public Task ShutdownDevices()
{
var shutdownTasks = InitializedDeviceContainers.Select(dc => dc.DisableDevice());
var startingDevices = DeviceContainers.Where(dc => dc.Device is { IsInitialized: false, IsDoingWork: true });
var shutdownTasks = InitializedDeviceContainers.Union(startingDevices).Select(dc => dc.DisableDevice());

return Task.WhenAll(shutdownTasks);
}
Expand Down

0 comments on commit 502713a

Please sign in to comment.