Beispiel #1
0
        private async void OnTelemetryTimerElapsed(object sender, TelemetryTimerEventArgs e)
        {
            telemetryRepository.Data.LastUploadDate = e.SignalTime;
            telemetryRepository.Save();

            await telemetryClient.SendPayload(GetPayload(telemetryRepository.Data));
        }
Beispiel #2
0
        private async void OnTelemetryTimerElapsed(object sender, TelemetryTimerEventArgs e)
        {
            try
            {
                telemetryRepository.Data.LastUploadDate = e.SignalTime;
                telemetryRepository.Save();

                await telemetryClient.SendPayload(GetPayload(telemetryRepository.Data));
            }
            catch (Exception ex) when(!ErrorHandler.IsCriticalException(ex))
            {
                // Suppress non-critical exceptions
                logger.WriteLine(Resources.Strings.Telemetry_ERROR_SendingTelemetry, ex.Message);
            }
        }