Esempio n. 1
0
        public async Task <FilePath?> Run(
            IGroupRun groupRun,
            PatcherPrepBundle prepBundle,
            CancellationToken cancellation,
            FilePath?sourcePath,
            RunParameters runParameters)
        {
            try
            {
                // Finish waiting for prep, if it didn't finish
                var prepException = await prepBundle.Prep.ConfigureAwait(false);

                if (prepException != null)
                {
                    return(null);
                }

                var args = GetRunArgs.GetArgs(
                    groupRun,
                    prepBundle.Run,
                    sourcePath,
                    runParameters);

                _fs.Directory.CreateDirectory(args.OutputPath.Directory !);

                _logger.Information("================= Starting Patcher {Patcher} Run =================", prepBundle.Run.Name);

                _reporter.ReportStartingRun(prepBundle.Run.Key, prepBundle.Run.Name);
                await prepBundle.Run.Run(args,
                                         cancel : cancellation).ConfigureAwait(false);

                if (cancellation.IsCancellationRequested)
                {
                    return(null);
                }

                return(FinalizePatcherRun.Finalize(prepBundle.Run, args.OutputPath));
            }
            catch (TaskCanceledException)
            {
                return(null);
            }
            catch (Exception ex)
            {
                _reporter.ReportRunProblem(prepBundle.Run.Key, prepBundle.Run.Name, ex);
                return(null);
            }
        }
Esempio n. 2
0
 public void ReportStartingRun(IPatcherRun patcher)
 {
     _wrapped.ReportStartingRun(patcher);
 }