Exemplo n.º 1
0
        public void Process(List <TableGroup> tableGroups, string fileNameAndPath)
        {
            var tableData = new List <DbTableContent>();

            foreach (TableGroup tableGroup in tableGroups)
            {
                tableData.AddRange(_databaseExtractor.ExtractTable(tableGroup));
            }

            _fileWriter.AppendToFile(tableData, fileNameAndPath);
        }
Exemplo n.º 2
0
        /// <summary>The save lines to file.</summary>
        private void SaveLinesToFile()
        {
            BecomeStacked(WritingData); // as we dont know how long write process will taxe

            try
            {
                _log.Debug($"Writing {_lines.Count} lines to file");
                var dt = DateTime.UtcNow;
                _fileWriter.AppendToFile(_lines);
                var elapsed = (DateTime.UtcNow - dt).TotalMilliseconds;
                _actorDictionary["FlowControlActor"].Tell(new FlowControlMessages.LinesSaved((uint)_lines.Count));

                _lines.Clear();
            }
            catch (Exception e)
            {
                _log.Error(e, "Cannot write lines");
                _actorDictionary["root"].Tell(new RootActorMessages.FatalError(e.Message));
            }

            UnbecomeStacked();
            Stash.UnstashAll();
        }