File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
src/ResourceManager/Version2016_09_01 Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 3030using System . Management . Automation ;
3131using System . Net . Http . Headers ;
3232using System . Security . Authentication ;
33+ using System . Threading ;
3334using System . Text ;
3435
3536namespace Microsoft . Azure . Commands . ResourceManager . Common
@@ -298,7 +299,7 @@ protected override void InitializeQosEvent()
298299 {
299300 _qosEvent . SubscriptionId = context . Subscription ? . Id ;
300301 _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 ) )
302303 {
303304 _qosEvent . Uid = MetricHelper . GenerateSha256HashString ( context . Account . Id . ToString ( ) ) ;
304305 }
@@ -546,5 +547,24 @@ private void EnqueueDebugSender(object sender, StreamEventArgs args)
546547 {
547548 DebugMessages . Enqueue ( args . Message ) ;
548549 }
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+ }
549569 }
550570}
You can’t perform that action at this time.
0 commit comments