File tree 1 file changed +21
-1
lines changed
src/ResourceManager/Version2016_09_01
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 30
30
using System . Management . Automation ;
31
31
using System . Net . Http . Headers ;
32
32
using System . Security . Authentication ;
33
+ using System . Threading ;
33
34
using System . Text ;
34
35
35
36
namespace Microsoft . Azure . Commands . ResourceManager . Common
@@ -298,7 +299,7 @@ protected override void InitializeQosEvent()
298
299
{
299
300
_qosEvent . SubscriptionId = context . Subscription ? . Id ;
300
301
_qosEvent . TenantId = context . Tenant ? . Id ;
301
- if ( context . Account != null && ! String . IsNullOrWhiteSpace ( context . Account . Id ) )
302
+ if ( context . Account != null && ! String . IsNullOrWhiteSpace ( context . Account . Id ) )
302
303
{
303
304
_qosEvent . Uid = MetricHelper . GenerateSha256HashString ( context . Account . Id . ToString ( ) ) ;
304
305
}
@@ -546,5 +547,24 @@ private void EnqueueDebugSender(object sender, StreamEventArgs args)
546
547
{
547
548
DebugMessages . Enqueue ( args . Message ) ;
548
549
}
550
+
551
+ private CancellationTokenSource _cancellationtokensource = null ;
552
+ protected CancellationTokenSource CancelTokenSource
553
+ {
554
+ get
555
+ {
556
+ if ( _cancellationtokensource == null )
557
+ {
558
+ _cancellationtokensource = new CancellationTokenSource ( ) ;
559
+ }
560
+ return _cancellationtokensource ;
561
+ }
562
+ }
563
+
564
+ protected override void StopProcessing ( )
565
+ {
566
+ CancelTokenSource ? . Cancel ( ) ;
567
+ base . StopProcessing ( ) ;
568
+ }
549
569
}
550
570
}
You can’t perform that action at this time.
0 commit comments