chore: run dotnet format

This commit is contained in:
Stevan Freeborn
2024-08-12 09:44:39 -05:00
parent 1af9c7012c
commit 4a52b012fe
6 changed files with 27 additions and 25 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
{
"editor.formatOnSave": true,
"dotnet.defaultSolution": "src/SanctionsSearch.sln",
"cSpell.words": ["OFAC"]
"cSpell.words": ["OFAC", "Szalay"]
}
@@ -1,7 +1,3 @@
using Moq;
using RichardSzalay.MockHttp;
namespace SanctionsSearch.Worker.Tests.Unit;
public class OfacFileServiceTests
+5 -1
View File
@@ -3,4 +3,8 @@ global using FluentAssertions;
global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Options;
global using SanctionsSearch.Worker.Services;
global using Moq;
global using RichardSzalay.MockHttp;
global using SanctionsSearch.Worker.Services;
+2 -2
View File
@@ -16,7 +16,7 @@ try
Log.Information("Starting Sanctions Search worker");
var builder = Host.CreateApplicationBuilder(args);
builder.Logging.ClearProviders();
builder.Logging.AddSerilog();
builder.Services.AddHostedService<Worker>();
@@ -33,4 +33,4 @@ catch (Exception ex)
finally
{
await Log.CloseAndFlushAsync();
}
}
+4 -2
View File
@@ -1,5 +1,7 @@
global using Microsoft.Extensions.Options;
global using SanctionsSearch.Worker;
global using Serilog;
global using Serilog.Formatting.Compact;
global using Serilog.Exceptions;
global using Microsoft.Extensions.Options;
global using Serilog.Formatting.Compact;
+15 -15
View File
@@ -2,22 +2,22 @@ namespace SanctionsSearch.Worker;
public class Worker : BackgroundService
{
private readonly ILogger<Worker> _logger;
private readonly ILogger<Worker> _logger;
public Worker(ILogger<Worker> logger)
{
_logger = logger;
}
public Worker(ILogger<Worker> logger)
{
_logger = logger;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
while (!stoppingToken.IsCancellationRequested)
{
if (_logger.IsEnabled(LogLevel.Information))
{
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
}
await Task.Delay(1000, stoppingToken);
}
if (_logger.IsEnabled(LogLevel.Information))
{
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
}
await Task.Delay(1000, stoppingToken);
}
}
}
}