public override async Task Invoke(IStepExecutionContext context = null) { var logger = ResolverFactory.Resolve <ILogger>("SyncService"); var errorLogger = ResolverFactory.Resolve <ILogger>("Error"); try { logger.Information($@"Queueing index changes of {IndexModel.Name}/{IndexModel.Id}..."); queueChangesManager.SetIndex(IndexModel); queueChangesManager.OnReport(s => logger.Information(s)); await queueChangesManager.QueueChanges(); logger.Information($@"Queued index changes of {IndexModel.Name}/{IndexModel.Id}"); } catch (Exception ex) { errorLogger.Error(ex, ex.Message); throw; } finally { Counter += 1; ResolverFactory.Release(logger); ResolverFactory.Release(errorLogger); logger = null; errorLogger = null; } }
public override async Task Invoke(IStepExecutionContext context = null) { Logger.Information($@"Queueing index changes of {IndexModel.Name}/{IndexModel.Id}..."); queueChangesManager.SetIndex(IndexModel); queueChangesManager.OnReport(s => Logger.Information(s)); await queueChangesManager.QueueChanges(); Logger.Information($@"Queued index changes of {IndexModel.Name}/{IndexModel.Id}"); }