Implement parsing
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user