Save all files to wwwroot

This commit is contained in:
2025-11-20 15:44:31 +09:00
parent 34c9a44b03
commit ee80c1a40b
4 changed files with 23 additions and 9 deletions

View File

@ -8,13 +8,19 @@ using Hcs.WebApp.Utils;
namespace Hcs.WebApp.BackgroundServices
{
public class OperationExecutionService(OperationExecutionState state, ExecutorFactory executorFactory, IServiceScopeFactory scopeFactory) : BackgroundService
public class OperationExecutionService(
OperationExecutionState state,
ExecutorFactory executorFactory,
IServiceScopeFactory scopeFactory,
IWebHostEnvironment webHostEnvironment) : BackgroundService
{
private const int SLEEP_TIME = 30000;
private const string OUTGOING_DIR_NAME = "outgoing";
private readonly OperationExecutionState state = state;
private readonly ExecutorFactory executorFactory = executorFactory;
private readonly IServiceScopeFactory scopeFactory = scopeFactory;
private readonly IWebHostEnvironment webHostEnvironment = webHostEnvironment;
private Broker.Logger.ILogger logger;
private IMessageCapturer messageCapturer;
@ -87,7 +93,7 @@ namespace Hcs.WebApp.BackgroundServices
private void InitializeClient()
{
logger = new ActionLogger();
messageCapturer = new FileMessageCapturer("outgoing", logger);
messageCapturer = new FileMessageCapturer(Path.Combine(webHostEnvironment.WebRootPath, OUTGOING_DIR_NAME), logger);
using var scope = scopeFactory.CreateScope();
var configuration = scope.ServiceProvider.GetRequiredService<IConfiguration>();