mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-12 14:57:13 +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() {
|
||||
try {
|
||||
cancellationTokenSource.Cancel();
|
||||
} catch (ObjectDisposedException) {}
|
||||
|
||||
taskChannel.Writer.Complete();
|
||||
cancellationTokenSource.Cancel();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user