File tree 1 file changed +18
-1
lines changed
src/Uno.DevTools.Telemetry
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,19 @@ public void Flush()
123
123
}
124
124
}
125
125
126
+ public async Task FlushAsync ( CancellationToken ct )
127
+ {
128
+ if ( ! Enabled || _trackEventTask == null )
129
+ {
130
+ return ;
131
+ }
132
+
133
+ if ( ! _trackEventTask . IsCompleted )
134
+ {
135
+ await Task . WhenAny ( _trackEventTask , Task . Delay ( - 1 , ct ) ) ;
136
+ }
137
+ }
138
+
126
139
public void Dispose ( )
127
140
{
128
141
_persistenceChannel ? . Dispose ( ) ;
@@ -162,7 +175,11 @@ private void InitializeTelemetry()
162
175
_commonProperties = new TelemetryCommonProperties ( _settingsStorageDirectoryPath , _versionAssembly , _currentDirectoryProvider ) . GetTelemetryCommonProperties ( ) ;
163
176
_commonMeasurements = new Dictionary < string , double > ( ) ;
164
177
165
- _telemetryConfig = new TelemetryConfiguration { InstrumentationKey = _instrumentationKey } ;
178
+ _telemetryConfig = new TelemetryConfiguration {
179
+ InstrumentationKey = _instrumentationKey ,
180
+ TelemetryChannel = _persistenceChannel
181
+ } ;
182
+
166
183
_client = new TelemetryClient ( _telemetryConfig ) ;
167
184
_client . InstrumentationKey = _instrumentationKey ;
168
185
_client . Context . User . Id = _commonProperties [ TelemetryCommonProperties . MachineId ] ;
You can’t perform that action at this time.
0 commit comments