aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStepan Goremykin <goremukin@gmail.com>2023-10-08 00:55:14 +0200
committerStepan Goremykin <goremukin@gmail.com>2023-10-08 00:55:14 +0200
commit6512f85ccb6081d41cd4fc9434a936df67a5f03a (patch)
tree1720b64431b0995594f1305dd7a7aad436d74348
parent160855ffe9aed4f2c379646081bbe1ac642fab70 (diff)
Pass cancellation token
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs2
-rw-r--r--RSSDP/SsdpDevicePublisher.cs4
2 files changed, 3 insertions, 3 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 44fe65103..e707eedbf 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -598,7 +598,7 @@ namespace MediaBrowser.Controller.Entities
for (var i = 0; i < childrenCount; i++)
{
- await actionBlock.SendAsync(i).ConfigureAwait(false);
+ await actionBlock.SendAsync(i, cancellationToken).ConfigureAwait(false);
}
actionBlock.Complete();
diff --git a/RSSDP/SsdpDevicePublisher.cs b/RSSDP/SsdpDevicePublisher.cs
index 950e6fec8..d4a70a975 100644
--- a/RSSDP/SsdpDevicePublisher.cs
+++ b/RSSDP/SsdpDevicePublisher.cs
@@ -243,7 +243,7 @@ namespace Rssdp.Infrastructure
}
// Do not block synchronously as that may tie up a threadpool thread for several seconds.
- Task.Delay(_Random.Next(16, (maxWaitInterval * 1000))).ContinueWith((parentTask) =>
+ Task.Delay(_Random.Next(16, (maxWaitInterval * 1000)), cancellationToken).ContinueWith((parentTask) =>
{
// Copying devices to local array here to avoid threading issues/enumerator exceptions.
IEnumerable<SsdpDevice> devices = null;
@@ -281,7 +281,7 @@ namespace Rssdp.Infrastructure
}
}
}
- });
+ }, cancellationToken);
}
private IEnumerable<SsdpDevice> GetAllDevicesAsFlatEnumerable()