Exemple #1
0
        /// <summary>
        /// Run the command.
        /// </summary>
        /// <param name="runner">Job runner.</param>
        public void Run(Runner runner, ServerJobRunner jobRunner, IDataStore storage)
        {
            jobRunner.Replacements = changes;
            var timer = Stopwatch.StartNew();
            List <Exception> errors = runner.Run();

            timer.Stop();
            Console.WriteLine($"Raw job took {timer.ElapsedMilliseconds}ms");
            if (errors != null && errors.Count > 0)
            {
                throw new AggregateException("File ran with errors", errors);
            }
        }
Exemple #2
0
 /// <summary>
 /// Run the command.
 /// </summary>
 /// <param name="runner">Job runner.</param>
 public void Run(Runner runner, ServerJobRunner jobRunner, IDataStore storage)
 {
     if (!storage.Reader.TableNames.Contains(TableName))
     {
         throw new Exception($"Table {TableName} does not exist in the database.");
     }
     Result = storage.Reader.GetData(TableName, fieldNames: Parameters);
     if (Result == null)
     {
         throw new Exception($"Unable to read table {TableName} from datastore (cause unknown - but the table appears to exist)");
     }
     foreach (string param in Parameters)
     {
         if (Result.Columns[param] == null)
         {
             throw new Exception($"Column {param} does not exist in table {TableName}");
         }
     }
     Result.TableName = TableName;
 }
Exemple #3
0
 /// <summary>
 /// Run the command.
 /// </summary>
 /// <param name="runner">Job runner.</param>
 public void Run(Runner runner, ServerJobRunner jobRunner, IDataStore storage)
 {
     Result           = storage.Reader.GetData(TableName, fieldNames: Parameters);
     Result.TableName = TableName;
 }