public async Task <FixActionLogger> DoAsync(CancellationToken cancellationToken, string lognameSuffix)
        {
            var logger = new FixActionLogger();

            logger.Start();
            try
            {
                var tasks = new[]
                {
                    _scanner.ScanForDiscrepanciesAsync(_integrityCheckConfiguration, logger, cancellationToken),
                    _fixer.FixDiscrepanciesAsync(logger, cancellationToken)
                };

                await Task.WhenAll(tasks);
            }
            catch (Exception ex)
            {
                logger.TerminalException = $"{ex.GetType().Name} - {ex.Message}";
                throw;
            }
            finally
            {
                logger.Finish();
                await SaveFixLoggerResults(logger, lognameSuffix);
            }

            return(logger);
        }
Exemple #2
0
        private void CheckPropertyPostFinish(Action <FixActionLogger> assert, Action <FixActionLogger> setup = null)
        {
            var logger = new FixActionLogger();

            logger.Start();
            setup?.Invoke(logger);
            logger.Finish();

            assert(logger);
        }