コード例 #1
0
        public void IngestStations()
        {
            var local = $"{DateTime.Now:yyyy-dd-M--HH-mm-ss}.csv";

            ftp.Download(local);
            var ls       = new CsvParser();
            var stations = ls.ParsStationCsv(local);

            InsertAllRows(stations);
        }
コード例 #2
0
 public void Process()
 {
     LogSystem.Log($"proc started {DateTime.Now}");
     while (_files.Count > 0)
     {
         var itm = _files.Dequeue();
         try
         {
             var ftp = new Ftp(itm.Remote);
             //the only reason that i download zip files on the machine is to create a simple resume & disaster recovery system and show that i am thinking of those
             // in my codes i will explain in the other part (Part 2) of my task what is the better solution
             ftp.Download(itm.Local);
             var tmpdir = Unzip(itm.Local);
             Ingest(tmpdir);
         }
         catch (Exception e)
         {
             LogSystem.Log($"proc file {itm.Local} failed at {DateTime.Now} due to {e.Message}");
         }
     }
 }