示例#1
0
        public async Task <IEnumerable <ConversionJob> > StartConversion(PantherClient panther, ExcelConverter converter, int max = 10)
        {
            System.Console.WriteLine("Downloading settlements from panther and uploading to conversion service.");

            List <KeyValuePair <string, SettlementHistory> > downloads =
                await DownloadMissingSettlements(panther, max);

            List <ConversionJob> jobs = new List <ConversionJob>();

            foreach (var download in downloads)
            {
                string filename = download.Key;

                ConversionJob job = new ConversionJob();
                job.Result = await converter.UploadAsync(filename);

                job.Company        = download.Value.CompanyId.ToString();
                job.SettlementId   = download.Value.SettlementId;
                job.SettlementDate = download.Value.SettlementDate;

                QueueUploaded(job);
                jobs.Add(job);
            }

            return(jobs);
        }
示例#2
0
 /// <summary>
 /// Places the result of the upload on a queue for another process to dequeue when ready.
 /// </summary>
 private void QueueUploaded(ConversionJob job)
 { /* Call DAPR? */
 }