fix some log messages

This commit is contained in:
Collin M. Barrett 2019-06-27 13:44:57 -05:00
parent be3a8d1eaf
commit 4354b74945
2 changed files with 10 additions and 3 deletions

View file

@ -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)

View file

@ -33,7 +33,6 @@ public Handler(ILogger<Handler> 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))