Implement parsing

This commit is contained in:
2025-11-22 11:10:03 +09:00
parent 8095bf8ebc
commit dfb60cb9f0
8 changed files with 102 additions and 13 deletions

View File

@ -7,13 +7,15 @@ namespace Hcs.WebApp.BackgroundServices
public class DataParsingService(
DataParsingState state,
DataParserFactory dataParserFactory,
IServiceScopeFactory scopeFactory) : BackgroundService
IServiceScopeFactory scopeFactory,
IWebHostEnvironment webHostEnvironment) : BackgroundService
{
private const int SLEEP_TIME = 30000;
private readonly DataParsingState state = state;
private readonly DataParserFactory dataParserFactory = dataParserFactory;
private readonly IServiceScopeFactory scopeFactory = scopeFactory;
private readonly IWebHostEnvironment webHostEnvironment = webHostEnvironment;
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
@ -36,7 +38,7 @@ namespace Hcs.WebApp.BackgroundServices
state.InvokeOnOperationStarted(operation.Id, operation.CampaignId, startedAt);
var dataParser = dataParserFactory.CreateDataParser(scope, operation);
var dataParser = dataParserFactory.CreateDataParser(scope, operation, webHostEnvironment);
await dataParser.ParseAsync();
}
catch (Exception e)