示例#1
0
        private void ImportData(IDataFilePathProvider pathProvider, DataLoadSettings settings = null)
        {
            _logger.LogInformation("Import daily data started for: {0:dd-MM-yyyy}", pathProvider.GetDate());
            var stopwatch = Stopwatch.StartNew();

            if (settings == null || settings.LoadExtendedEvents)
            {
                LoadExtendedEvents(pathProvider);
            }
            _dateRepository.Refresh();
            ImportJsonLogs(pathProvider);
            stopwatch.Stop();
            _logger.LogInformation("Import daily data completed in: {0}", stopwatch.Elapsed);
        }
示例#2
0
        public void ImportAllByDates(IEnumerable <DateTime> dates)
        {
            BackupDb();
            var settings = new DataLoadSettings {
                LoadExtendedEvents = false
            };

            foreach (DateTime dateTime in dates)
            {
                var pathProvider = new DataFilePathProvider(_settings, new StaticDateTimeProvider(dateTime),
                                                            (ILogger <DataFilePathProvider>)_serviceProvider.GetService(typeof(ILogger <DataFilePathProvider>)),
                                                            (IFileSystem)_serviceProvider.GetService(typeof(IFileSystem)));
                var provider = new CompositePathProvider(pathProvider);
                ImportData(provider, settings);
            }
            ActualizeInfo();
        }