mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-06-06 18:33:21 +03:00
Fix random exceptions when disposing DelayedThrottledTask
This commit is contained in:
parent
e7c52fd1d5
commit
5741fad528
@ -55,7 +55,10 @@ public sealed class DelayedThrottledTask<T> : IDisposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
|
try {
|
||||||
|
cancellationTokenSource.Cancel();
|
||||||
|
} catch (ObjectDisposedException) {}
|
||||||
|
|
||||||
taskChannel.Writer.Complete();
|
taskChannel.Writer.Complete();
|
||||||
cancellationTokenSource.Cancel();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user