From b1fb724bda722315b721329dfec1ab62776600cb Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Thu, 27 Jun 2019 13:44:57 -0500 Subject: [PATCH] fix some log messages --- src/FilterLists.Agent/ListArchiver/DownloadList.cs | 12 ++++++++++-- .../DownloadRequestsByFileExtension/DownloadTxt.cs | 1 - 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/FilterLists.Agent/ListArchiver/DownloadList.cs b/src/FilterLists.Agent/ListArchiver/DownloadList.cs index 7403826bd..29c840eac 100644 --- a/src/FilterLists.Agent/ListArchiver/DownloadList.cs +++ b/src/FilterLists.Agent/ListArchiver/DownloadList.cs @@ -69,10 +69,18 @@ protected override async Task Handle(Command request, CancellationToken cancella { var extension = Path.GetExtension(request.ListInfo.ViewUrl.AbsolutePath); if (DownloadRequestsByFileExtension.ContainsKey(extension)) + { + _logger.LogInformation( + $"Downloading list {request.ListInfo.Id} from {request.ListInfo.ViewUrl}..."); await _mediator.Send(DownloadRequestsByFileExtension[extension].Invoke(request.ListInfo), cancellationToken); - _logger.LogWarning( - $"File extension not recognized for list {request.ListInfo.Id} from {request.ListInfo.ViewUrl}."); + } + else + { + _logger.LogWarning( + $"File extension not recognized for list {request.ListInfo.Id} from {request.ListInfo.ViewUrl}."); + } + //TODO: upsert into MariaDB Rules table https://stackoverflow.com/questions/15271202/mysql-load-data-infile-with-on-duplicate-key-update } catch (NotImplementedException) diff --git a/src/FilterLists.Agent/ListArchiver/DownloadRequestsByFileExtension/DownloadTxt.cs b/src/FilterLists.Agent/ListArchiver/DownloadRequestsByFileExtension/DownloadTxt.cs index 8f0e9fb10..7349eb50b 100644 --- a/src/FilterLists.Agent/ListArchiver/DownloadRequestsByFileExtension/DownloadTxt.cs +++ b/src/FilterLists.Agent/ListArchiver/DownloadRequestsByFileExtension/DownloadTxt.cs @@ -33,7 +33,6 @@ public Handler(ILogger logger, HttpClient httpClient) protected override async Task Handle(Command request, CancellationToken cancellationToken) { - _logger.LogInformation($"Downloading list {request.ListInfo.Id} from {request.ListInfo.ViewUrl}..."); try { using (var result = await _httpClient.GetAsync(request.ListInfo.ViewUrl, cancellationToken))