feat(all): Проекты под задачи синхронизации нарядов еспп и агентов
This commit is contained in:
17
PARR.EsppOrderLoaderWorker/PARR.EsppOrderLoaderWorker.csproj
Normal file
17
PARR.EsppOrderLoaderWorker/PARR.EsppOrderLoaderWorker.csproj
Normal file
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Worker">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>dotnet-PARR.EsppOrderLoaderWorker-9450cc7f-81ad-4405-8442-7d14419c7952</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PARR.EsppOrderLoader\PARR.EsppOrderLoader.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
10
PARR.EsppOrderLoaderWorker/Program.cs
Normal file
10
PARR.EsppOrderLoaderWorker/Program.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using PARR.EsppOrderLoaderWorker;
|
||||
|
||||
IHost host = Host.CreateDefaultBuilder(args)
|
||||
.ConfigureServices(services =>
|
||||
{
|
||||
services.AddHostedService<Worker>();
|
||||
})
|
||||
.Build();
|
||||
|
||||
host.Run();
|
||||
11
PARR.EsppOrderLoaderWorker/Properties/launchSettings.json
Normal file
11
PARR.EsppOrderLoaderWorker/Properties/launchSettings.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"profiles": {
|
||||
"PARR.EsppOrderLoaderWorker": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"environmentVariables": {
|
||||
"DOTNET_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
PARR.EsppOrderLoaderWorker/Worker.cs
Normal file
21
PARR.EsppOrderLoaderWorker/Worker.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace PARR.EsppOrderLoaderWorker
|
||||
{
|
||||
public class Worker : BackgroundService
|
||||
{
|
||||
private readonly ILogger<Worker> _logger;
|
||||
|
||||
public Worker(ILogger<Worker> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
while (!stoppingToken.IsCancellationRequested)
|
||||
{
|
||||
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
||||
await Task.Delay(1000, stoppingToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
8
PARR.EsppOrderLoaderWorker/appsettings.Development.json
Normal file
8
PARR.EsppOrderLoaderWorker/appsettings.Development.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
8
PARR.EsppOrderLoaderWorker/appsettings.json
Normal file
8
PARR.EsppOrderLoaderWorker/appsettings.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user