File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/Connector.DataLake.Common Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1+ ### Fixes
2+ - Handle TaskCanceledException when stop/starting a stream
Original file line number Diff line number Diff line change @@ -75,7 +75,14 @@ private async Task Idle()
7575 {
7676 while ( true )
7777 {
78- await Task . Delay ( 100 , _idleCancellationTokenSource . Token ) ;
78+ try
79+ {
80+ await Task . Delay ( 100 , _idleCancellationTokenSource . Token ) ;
81+ }
82+ catch ( TaskCanceledException taskCanceledException )
83+ {
84+ // TODO add log
85+ }
7986
8087 if ( ! _idleCancellationTokenSource . IsCancellationRequested && DateTime . Now . Subtract ( _lastAdded ) . TotalMilliseconds < _timeout )
8188 {
@@ -159,7 +166,9 @@ public async Task Flush()
159166 var t = _idleTask ;
160167 if ( t != null )
161168 {
169+ Console . WriteLine ( "Canceling" ) ;
162170 _idleCancellationTokenSource . Cancel ( ) ;
171+ Console . WriteLine ( "Canceled" ) ;
163172
164173 await t ;
165174 }
You can’t perform that action at this time.
0 commit comments