Exemple #1
0
        public override async Task Process()
        {
            try
            {
                if (_isUpdated)
                {
                    using (var client = new WebClient())
                    {
                        var url         = _settings.DataTransformationApiUrl;
                        var failedItems = client.DownloadString($"{url}/api/DataTransformationLog/{RunId}");

                        var logItem = new LogItem()
                        {
                            IsSucceeded = string.IsNullOrWhiteSpace(failedItems),
                            FailedRows  = JsonConvert.DeserializeObject <List <string> >(failedItems),
                            StartDate   = DateTime.Now
                        };

                        if (!string.IsNullOrWhiteSpace(failedItems))
                        {
                            await _smtpService.SendEmailAsync(_email, "Error", failedItems);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Exception occured, while executing TalendHandler");
            }
        }