chore: run dotnet format
This commit is contained in:
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"dotnet.defaultSolution": "src/SanctionsSearch.sln",
|
"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;
|
namespace SanctionsSearch.Worker.Tests.Unit;
|
||||||
|
|
||||||
public class OfacFileServiceTests
|
public class OfacFileServiceTests
|
||||||
|
|||||||
@@ -3,4 +3,8 @@ global using FluentAssertions;
|
|||||||
global using Microsoft.Extensions.Logging;
|
global using Microsoft.Extensions.Logging;
|
||||||
global using Microsoft.Extensions.Options;
|
global using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
global using SanctionsSearch.Worker.Services;
|
global using Moq;
|
||||||
|
|
||||||
|
global using RichardSzalay.MockHttp;
|
||||||
|
|
||||||
|
global using SanctionsSearch.Worker.Services;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ try
|
|||||||
Log.Information("Starting Sanctions Search worker");
|
Log.Information("Starting Sanctions Search worker");
|
||||||
|
|
||||||
var builder = Host.CreateApplicationBuilder(args);
|
var builder = Host.CreateApplicationBuilder(args);
|
||||||
|
|
||||||
builder.Logging.ClearProviders();
|
builder.Logging.ClearProviders();
|
||||||
builder.Logging.AddSerilog();
|
builder.Logging.AddSerilog();
|
||||||
builder.Services.AddHostedService<Worker>();
|
builder.Services.AddHostedService<Worker>();
|
||||||
@@ -33,4 +33,4 @@ catch (Exception ex)
|
|||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
await Log.CloseAndFlushAsync();
|
await Log.CloseAndFlushAsync();
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
global using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
global using SanctionsSearch.Worker;
|
global using SanctionsSearch.Worker;
|
||||||
|
|
||||||
global using Serilog;
|
global using Serilog;
|
||||||
global using Serilog.Formatting.Compact;
|
|
||||||
global using Serilog.Exceptions;
|
global using Serilog.Exceptions;
|
||||||
global using Microsoft.Extensions.Options;
|
global using Serilog.Formatting.Compact;
|
||||||
|
|||||||
@@ -2,22 +2,22 @@ namespace SanctionsSearch.Worker;
|
|||||||
|
|
||||||
public class Worker : BackgroundService
|
public class Worker : BackgroundService
|
||||||
{
|
{
|
||||||
private readonly ILogger<Worker> _logger;
|
private readonly ILogger<Worker> _logger;
|
||||||
|
|
||||||
public Worker(ILogger<Worker> logger)
|
public Worker(ILogger<Worker> logger)
|
||||||
{
|
{
|
||||||
_logger = 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))
|
||||||
{
|
{
|
||||||
if (_logger.IsEnabled(LogLevel.Information))
|
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
||||||
{
|
}
|
||||||
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
await Task.Delay(1000, stoppingToken);
|
||||||
}
|
|
||||||
await Task.Delay(1000, stoppingToken);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user