Save all files to wwwroot
This commit is contained in:
@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user