Save all files to wwwroot
This commit is contained in:
@ -12,7 +12,8 @@ namespace Hcs.WebApp.BackgroundServices
|
||||
public class ResultGetService(
|
||||
ResultGetState state,
|
||||
ResultGetterFactory resultGetterFactory,
|
||||
IServiceScopeFactory scopeFactory) : BackgroundService
|
||||
IServiceScopeFactory scopeFactory,
|
||||
IWebHostEnvironment webHostEnvironment) : BackgroundService
|
||||
{
|
||||
private class GetState
|
||||
{
|
||||
@ -23,10 +24,12 @@ namespace Hcs.WebApp.BackgroundServices
|
||||
|
||||
private const int ITERATION_TIME = 10000;
|
||||
private const int SLEEP_TIME = 30000;
|
||||
private const string INCOMING_DIR_NAME = "incoming";
|
||||
|
||||
private readonly ResultGetState state = state;
|
||||
private readonly ResultGetterFactory resultGetterFactory = resultGetterFactory;
|
||||
private readonly IServiceScopeFactory scopeFactory = scopeFactory;
|
||||
private readonly IWebHostEnvironment webHostEnvironment = webHostEnvironment;
|
||||
private readonly List<(Operation operation, GetState state)> entries = [];
|
||||
|
||||
private Broker.Logger.ILogger logger;
|
||||
@ -130,7 +133,7 @@ namespace Hcs.WebApp.BackgroundServices
|
||||
private void InitializeClient()
|
||||
{
|
||||
logger = new ActionLogger();
|
||||
messageCapturer = new FileMessageCapturer("incoming", logger);
|
||||
messageCapturer = new FileMessageCapturer(Path.Combine(webHostEnvironment.WebRootPath, INCOMING_DIR_NAME), logger);
|
||||
|
||||
using var scope = scopeFactory.CreateScope();
|
||||
var configuration = scope.ServiceProvider.GetRequiredService<IConfiguration>();
|
||||
|
||||
Reference in New Issue
Block a user